Skip to content

Commit

Permalink
Migrate from bnd-maven-plugin to bnd-maven-plugin for finer OSGi meta…
Browse files Browse the repository at this point in the history
…data

fixes #3842

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
  • Loading branch information
rotty3000 committed Dec 18, 2020
1 parent d5ca168 commit 18b870a
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 108 deletions.
20 changes: 12 additions & 8 deletions modules/swagger-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,26 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swagger-annotations</artifactId>
<packaging>bundle</packaging>
<name>swagger-annotations</name>
<description>swagger-annotations</description>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<instructions>
<Automatic-Module-Name>io.swagger.v3.oas.annotations</Automatic-Module-Name>
</instructions>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>io.swagger.v3.oas.annotations</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
Expand Down
25 changes: 16 additions & 9 deletions modules/swagger-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swagger-core</artifactId>
<packaging>bundle</packaging>
<name>swagger-core</name>
<description>swagger-core</description>
<build>
Expand All @@ -29,22 +28,30 @@
</testResources>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Automatic-Module-Name>io.swagger.v3.core</Automatic-Module-Name>
<Import-Package>javax.validation.constraints;version="[1.1,3)",*</Import-Package>
</instructions>
<bnd>
Import-Package: javax.validation.constraints;version="[1.1,3)",*
</bnd>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>io.swagger.v3.core</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<goals>
<goal>test-jar</goal>
Expand Down
28 changes: 16 additions & 12 deletions modules/swagger-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<relativePath>../..</relativePath>
</parent>
<artifactId>swagger-integration</artifactId>
<packaging>bundle</packaging>
<name>swagger-integration</name>
<description>swagger-integration</description>
<dependencies>
Expand Down Expand Up @@ -43,17 +42,22 @@
<sourceDirectory>src/main/java</sourceDirectory>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Automatic-Module-Name>io.swagger.v3.oas.integration</Automatic-Module-Name>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>io.swagger.v3.oas.integration</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
29 changes: 13 additions & 16 deletions modules/swagger-jaxrs2-servlet-initializer-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId>
<packaging>bundle</packaging>
<name>swagger-jaxrs2-servlet-initializer-v2</name>
<description>swagger-servlet-initializer-v2</description>
<build>
Expand All @@ -23,22 +22,20 @@
</testResources>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>
io.swagger.v3.jaxrs2.integration.servlet
</Export-Package>
<Import-Package>
javax.ws.rs*;version="2.0",
*
</Import-Package>
<Automatic-Module-Name>io.swagger.v3.jaxrs2.integration.servlet</Automatic-Module-Name>
</instructions>
</configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>io.swagger.v3.jaxrs2.integration.servlet</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
32 changes: 17 additions & 15 deletions modules/swagger-jaxrs2-servlet-initializer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swagger-jaxrs2-servlet-initializer</artifactId>
<packaging>bundle</packaging>
<name>swagger-jaxrs2-servlet-initializer</name>
<description>swagger-servlet-initializer</description>
<build>
Expand All @@ -23,21 +22,24 @@
</testResources>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>
io.swagger.v3.jaxrs2.integration
</Export-Package>
<Import-Package>
javax.ws.rs*;version="2.0",
*
</Import-Package>
<Automatic-Module-Name>io.swagger.v3.jaxrs2.integration</Automatic-Module-Name>
</instructions>
<bnd>
Export-Package: io.swagger.v3.jaxrs2.integration
</bnd>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>io.swagger.v3.jaxrs2.integration</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
Expand Down
32 changes: 12 additions & 20 deletions modules/swagger-jaxrs2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swagger-jaxrs2</artifactId>
<packaging>bundle</packaging>
<name>swagger-jaxrs2</name>
<description>swagger-jaxrs2</description>
<build>
Expand All @@ -23,26 +22,19 @@
</testResources>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>
io.swagger.v3.jaxrs2,
io.swagger.v3.jaxrs2.ext,
io.swagger.v3.jaxrs2.integration,
io.swagger.v3.jaxrs2.integration.api,
io.swagger.v3.jaxrs2.integration.resources,
io.swagger.v3.jaxrs2.util
</Export-Package>
<Import-Package>
javax.ws.rs*;version="2.0",
*
</Import-Package>
<Automatic-Module-Name>io.swagger.v3.jaxrs2</Automatic-Module-Name>
</instructions>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>io.swagger.v3.jaxrs2</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
Expand Down
34 changes: 12 additions & 22 deletions modules/swagger-models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>swagger-models</artifactId>
<packaging>bundle</packaging>
<name>swagger-models</name>
<description>swagger-models</description>
<build>
Expand All @@ -22,28 +21,19 @@
</testResources>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>
io.swagger.v3.oas.models,
io.swagger.v3.oas.models.callbacks,
io.swagger.v3.oas.models.examples,
io.swagger.v3.oas.models.headers,
io.swagger.v3.oas.models.info,
io.swagger.v3.oas.models.links,
io.swagger.v3.oas.models.media,
io.swagger.v3.oas.models.parameters,
io.swagger.v3.oas.models.responses,
io.swagger.v3.oas.models.security,
io.swagger.v3.oas.models.servers,
io.swagger.v3.oas.models.tags
</Export-Package>
<Automatic-Module-Name>io.swagger.v3.oas.models</Automatic-Module-Name>
</instructions>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>io.swagger.v3.oas.models</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
Expand Down
50 changes: 44 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,49 @@
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>${bnd-version}</version>
<configuration>
<bnd><![CDATA[
Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
-exportcontents: ${packages;NAMED;!*.internal}
-noextraheaders: true
-noclassforname: true
-snapshot: SNAPSHOT
-contract: \
JavaJAXRS;resolution:=optional,\
JavaServlet;resolution:=optional
-define-contract: \
osgi.contract;\
osgi.contract=JavaJAXRS;\
version:List<Version>="2.0";\
uses:="\
javax.ws.rs,\
javax.ws.rs.core,\
javax.ws.rs.ext,\
javax.ws.rs.client,\
javax.ws.rs.container",\
osgi.contract;\
osgi.contract=JavaServlet;\
version:List<Version>="4.0";\
uses:="\
javax.servlet,\
javax.servlet.annotation,\
javax.servlet.descriptor,\
javax.servlet.http"
-cdiannotations:
]]></bnd>
</configuration>
<executions>
<execution>
<goals>
<goal>bnd-process</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down Expand Up @@ -380,11 +423,6 @@
<artifactId>maven-plugin-tools-api</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${felix-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-ext</artifactId>
Expand Down Expand Up @@ -561,7 +599,7 @@
<jakarta.ws-version>2.1.6</jakarta.ws-version>
<jakarta.xml.bind-api-version>2.3.3</jakarta.xml.bind-api-version>
<jakarta.activation-api-version>1.2.2</jakarta.activation-api-version>
<felix-version>4.2.1</felix-version>
<bnd-version>5.1.2</bnd-version>
<servlet-api-version>4.0.3</servlet-api-version>
<jersey2-version>2.26</jersey2-version>
<junit-version>4.13.1</junit-version>
Expand Down

0 comments on commit 18b870a

Please sign in to comment.