Skip to content

Commit

Permalink
Switch to bnd-maven-plugin in order to support Multi-Release OSGi bun…
Browse files Browse the repository at this point in the history
…dle JAR's via supplemental manifest files.
  • Loading branch information
norrisjeremy committed Jan 3, 2024
1 parent fe26a2c commit 76f1bdb
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
java-version: ${{ matrix.java }}
check-latest: true
- name: Test with Maven
run: ./mvnw -B -V -e -P coverage verify -Denforcer.skip=true -Dmaven.resources.skip=true -Dmaven.main.skip=true -Dassembly.skipAssembly=true -Dmaven.javadoc.skip=true -DskipITs=false
run: ./mvnw -B -V -e -P coverage verify -Denforcer.skip=true -Dmaven.resources.skip=true -Dmaven.main.skip=true -Dbnd.skip=true -Dassembly.skipAssembly=true -Dmaven.javadoc.skip=true -Dcyclonedx.skip=true -DskipITs=false
- uses: actions/upload-artifact@v4
with:
name: java-${{ matrix.java }}-testresults
Expand Down
72 changes: 49 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@
<timezone>+9</timezone>
</developer>
<developer>
<id>mwiede</id>
<name>Matthias Wiedemann</name>
<email>[email protected]</email>
<organization>Community</organization>
<organizationUrl>https://github.com/mwiede</organizationUrl>
</developer>
<developer>
<id>norrisjeremy</id>
<name>Jeremy Norris</name>
<organization>Community</organization>
<organizationUrl>https://github.com/norrisjeremy</organizationUrl>
Expand Down Expand Up @@ -254,7 +256,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>16</version>
<version>17</version>
</requireJavaVersion>
<dependencyConvergence />
<banDuplicatePomDependencyVersions />
Expand Down Expand Up @@ -403,31 +405,32 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.9</version>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>7.0.0</version>
<configuration>
<instructions>
<Export-Package>com.jcraft.jsch;-noimport:=true</Export-Package>
<Import-Package><![CDATA[
com.sun.jna*;version="${range;[=0,+)}",
org.apache.logging.log4j*;version="${range;[=0,4)}",
org.bouncycastle*;version="[1.76,${versionmask;+})",
org.slf4j*;version="[1.7,${versionmask;+})",
org.ietf.jgss;resolution:=optional,
<bnd><![CDATA[
-noextraheaders: false
-removeheaders: \
Bnd-LastModified,\
Bundle-Developers,\
Bundle-DocURL,\
Bundle-SCM,\
Created-By,\
Private-Package
Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
Export-Package: com.jcraft.jsch;-noimport:=true
Import-Package: \
com.sun.jna*;version="${range;[=0,+)}";resolution:=optional,\
org.apache.logging.log4j*;version="${range;[=0,4)}";resolution:=optional,\
org.bouncycastle*;version="[1.76,${versionmask;+})";resolution:=optional,\
org.slf4j*;version="[1.7,${versionmask;+})";resolution:=optional,\
org.newsclub.net.unix;resolution:=optional,\
org.ietf.jgss;resolution:=optional,\
!java.*,\
*
]]></Import-Package>
</instructions>
]]></bnd>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -862,5 +865,28 @@
</plugins>
</build>
</profile>
<profile>
<id>bnd</id>
<activation>
<jdk>[17,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<executions>
<execution>
<id>bnd-process</id>
<phase>process-classes</phase>
<goals>
<goal>bnd-process</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 76f1bdb

Please sign in to comment.