Skip to content

Commit

Permalink
For #65, use maven-bundle-plugin to build JAR as OSGi bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
pholser committed Sep 13, 2014
1 parent 7aa4fa2 commit ed593c8
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
Expand Down Expand Up @@ -143,15 +143,38 @@
-->
</executions>
</plugin>
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-jar-plugin</artifactId>-->
<!--<version>2.3.2</version>-->
<!--<configuration>-->
<!--<excludes>-->
<!--<exclude>joptsimple/examples/**</exclude>-->
<!--</excludes>-->
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<excludes>
<exclude>joptsimple/examples/**</exclude>
</excludes>
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>joptsimple,joptsimple.util</Export-Package>
<Private-Package>joptsimple.internal</Private-Package>
</instructions>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down

1 comment on commit ed593c8

@aborg0
Copy link

@aborg0 aborg0 commented on ed593c8 Sep 13, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I have tried it with a simple OSGi test project and could not load classes from the internal package, but could from the other two.
Thank you for the fast response.

Please sign in to comment.