0

How can I achieve that the plugin does not inline the dependencies in the new build jar file?

<build>
  <plugins>
   <plugin>
     <groupId>org.apache.felix</groupId>
     <artifactId>maven-bundle-plugin</artifactId>
     <extensions>true</extensions>
     <configuration>
       <instructions>
         <Bundle-Category>tools</Bundle-Category>
         <Fragment-Host>org.jsmpp.jsmpp</Fragment-Host>
         <Private-Package>!</Private-Package>
         <Export-Package>
           org.jsmpp.*;version="2.2.3"
         </Export-Package>
         <Import-Package>!org.slf4j</Import-Package>
         <Bundle-Version>2.2.3</Bundle-Version>
       </instructions>
     </configuration>
   </plugin>
  </plugins>
</build>
<dependencies>
  <dependency>
    <groupId>org.jsmpp</groupId>
    <artifactId>jsmpp</artifactId>
  </dependency>
</dependencies>
Benny
  • 1,435
  • 1
  • 15
  • 33

3 Answers3

1

The plugin does not inline any dependencies, unless you include an Embed-Dependency instruction. That instruction can be inherited from a parent POM.

Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
  • I think this would have been right, I won't do any changes to this since it was just a workaround anyway. I provided a final MANIFEST now and it is packaged within the jar. – Benny Feb 15 '16 at 08:51
0

All packages that match the <Export-Package> instruction are included in the bundle, even if those packages come from a dependency. So you can either specify all packages from your bundle explicitly, or use a wildcard and exclude unwanted packages with the '!' prefix, e.g.

<Export-Package>
    org.jsmpp.*;version="2.2.3",
    !org.jsmpp.donotwant
</Export-Package>

see maven-bundle-plugin documentation

0

Use _exportcontents instead of Export-Package.

_exportcontents affect only the manifest, whereas Export-Package modify the manifest and the content of your bundle.

see: http://www.aqute.biz/Bnd/Format

Jérémie B
  • 10,611
  • 1
  • 26
  • 43