Used with Bnd the Export-Package is a directive that will be processed.
It means that it's value is not copy/pasted as is in the final MANIFEST,
but instead, its content is used (as instructions/intentions) to
construct the jar file.
So in your case, you tell Bnd to place the 'org.livetribe.slp.*'
packages inside your bundle.
bnd will use your project's dependencies to find theses packages.
If it does not find them, it print the message you see.
BTW, if you use the Export-Package directive, you don't need to have
slp.jar in your bundle classpath, as the packages are directly placed at
the root of your bundle.
So, in your case, you have 2 equivalent choices (bundles will not have
the exact same content, but the same set of package will be exported):
* add slp.jar as a dependency (should be done for the 2 solutions)
1) use Embed-Dependency slp and change <Export-Package> with
<_exportcontents> (the packages will no more be copied at the root of
the bundle, they are still in the slp.jar, and the Bundle-ClassPath
attribute points to the slp.jar)
2) just remove the <Bundle-ClassPath> element, Bnd compute everything
for you using the directives.
Regards
--Guillaume
Alan D. Cabrera a écrit :
I have the following in my POM
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.3</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>
org.livetribe.slp.osgi,
org.livetribe.slp,
org.livetribe.slp.da,
org.livetribe.slp.sa,
org.livetribe.slp.settings,
org.livetribe.slp.spi,
org.livetribe.slp.spi.da,
org.livetribe.slp.spi.filter,
org.livetribe.slp.spi.msg,
org.livetribe.slp.spi.net,
org.livetribe.slp.spi.sa,
org.livetribe.slp.spi.ua,
org.livetribe.slp.ua,
org.livetribe.slp.util,
org.livetribe.slp.util.logging
</Export-Package>
<Bundle-ClassPath>.,lib/slp.jar</Bundle-ClassPath>
<Bundle-RequiredExecutionEnvironment>J2SE-1.5,JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
</instructions>
</configuration>
</plugin>
and I get this warning
[WARNING] Warning building bundle
org.livetribe.slp:livetribe-slp-osgi:bundle:2.1.0-SNAPSHOT :
Instructions for Export-Package that are never used:
org\.livetribe\.slp\.spi\.da, org\.livetribe\.slp\.ua,
org\.livetribe\.slp, org\.livetribe\.slp\.util\.logging,
org\.livetribe\.slp\.sa, org\.livetribe\.slp\.settings,
org\.livetribe\.slp\.spi\.net, org\.livetribe\.slp\.util,
org\.livetribe\.slp\.spi, org\.livetribe\.slp\.spi\.sa,
org\.livetribe\.slp\.spi\.ua, org\.livetribe\.slp\.spi\.msg,
org\.livetribe\.slp\.da, org\.livetribe\.slp\.spi\.filter
The jar file lib/slp.jar has the packages. What am I doing wrong?
Regards,
Alan