Hi,
I am quite new to OSGi so please excuse my ignorance, but isn't the
WAB format now the preferred one, with the OSGi Enterprise 4.2
specification? How would one produce the wab bundle, is there an easy
way to do this with Maven?
Thanks,
Petr
From: Rickard Öberg <[email protected]>
Date: July 9, 2010 6:19:47 AM GMT+02:00
To: [email protected]
Subject: Maven BND plugin and building WAR files with dependencies
Hi,
I'm using the Maven BND plugin to generate the manifest for a WAR
file that contains embedded dependencies. I have tried to follow all
the guidelines out there (OPS4J+Apache websites), but without luck.
The main problem seems to be that the plugin cannot recognize where
the embedded dependencies are. My POM BND instructions look like this:
<Export-Package>
... exported packages *from embedded dependencies* goes here...
... exported packages from WAR project goes here ...
</Export-Package>
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
<Embed-Directory>WEB-INF/lib/</Embed-Directory>
... more instructions ...
When I run Maven on this it generates warnings like this:
[WARNING] Warning in manifest for
se.streamsource.streamflow:streamflow-web:war:1.1-SNAPSHOT : No sub
JAR or directory WEB-INF/classes
[WARNING] Warning in manifest for
se.streamsource.streamflow:streamflow-web:war:1.1-SNAPSHOT : No sub
JAR or directory WEB-INF/lib/somedependency.jar
... and so on with one warning line for each embedded jar ...
The resulting WAR has the correct WEB-INF/lib with all the jar
files, the BundleClasspath header *is correct* (with all WEB-INF/lib
dependencies added to it), but the ExportPackage header is wrong as
it does not include the packages from the dependencies that I want
to export. Funnily enough, the corresponding ImportPackage header
*is correct*, i.e. it includes imports of the packages I wanted to
export!
Am I doing something wrong here, or is the BND plugin not able to
handle WAR files with embedded dependencies properly yet?
thanks, Rickard