Blob Blame History Raw
From c2fd092f97e4ec6ee700f134bc1b52b62b8630a2 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Thu, 27 Aug 2020 10:27:01 +0100
Subject: [PATCH 1/4] Update to latest version of bnd-maven-plugin

This version has a couple of advantages:

1) It is aware of module-info.class files, which means we don't
need to manually override the "Require-Capability" header.

2) External packages used by reflection are now detected, i.e.
the "sun.misc" package is now added to the "Import-Package"
header. This is manually given optional resolution since it
is obviously not present on all JVMs.

3) It also introduces some new useful OSGi headers:
 - Bundle-DocURL (overriden with correct URL for manual)
 - Bundle-License
 - Bundle-SCM

This change also removes unnecessary mention of the felix
bundle-plugin in the pluginManagement section of the parent pom.

Signed-off-by: Mat Booth <mat.booth@redhat.com>
---
 gson/bnd.bnd | 2 ++
 gson/pom.xml | 2 +-
 pom.xml      | 6 ------
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/gson/bnd.bnd b/gson/bnd.bnd
index c98fcfd..7706d8a 100644
--- a/gson/bnd.bnd
+++ b/gson/bnd.bnd
@@ -3,7 +3,9 @@ Bundle-Name: ${project.name}
 Bundle-Description: ${project.description}
 Bundle-Vendor: Google Gson Project
 Bundle-ContactAddress: ${project.parent.url}
+Bundle-DocURL: ${project.parent.url}/blob/master/UserGuide.md
 Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8
+Import-Package: sun.misc;resolution:=optional,*
 
 -removeheaders: Private-Package
 
diff --git a/gson/pom.xml b/gson/pom.xml
index ffe41ac..909a91a 100644
--- a/gson/pom.xml
+++ b/gson/pom.xml
@@ -34,7 +34,7 @@
       <plugin>
         <groupId>biz.aQute.bnd</groupId>
         <artifactId>bnd-maven-plugin</artifactId>
-        <version>4.0.0</version>
+        <version>5.1.2</version>
         <executions>
           <execution>
             <goals>
diff --git a/pom.xml b/pom.xml
index 4774e70..8716014 100644
--- a/pom.xml
+++ b/pom.xml
@@ -103,12 +103,6 @@
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-jar-plugin</artifactId>
         </plugin>
-        <plugin>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>maven-bundle-plugin</artifactId>
-          <version>3.3.0</version>
-          <inherited>true</inherited>
-        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
-- 
2.26.2