David,
This came up today for me. In my application, we use 16 .jar files that are not OSGI-friendly. In our features.xml files we are using the wrap:mvn urn to deploy these into karaf. Normally, we would create wrapped versions of these files using bnd, prepending "osgi" to the version number of the bundle for official product releases. Unfortunately, this is not sustainable for releases as we would need to re-wrap all of these .jar files if they are updated. Karaf should have a way to easily deploy non-OSGi .jar files. This purpose was filled by the wrap:mvn urn, but that also appears to be buggy. In my usage, I get the following exception when using wrap:mvn: <date> | WARN | Thread-# | BndUtils | ps4j.pax.swissbox.bnd.BndUtils$1 <#> | # - org.ops4j.pax.url.wrap - 1.2.5 | Bundle cannot be generated. If the answer is that we need to wrap all of the unfriendly .jar files manually, this is a strike against OSGi. Are there other options available other than wrap:mvn? ----- Original Message ----- From: "David Jencks [via Karaf]" <[email protected]> To: "mikevan" <[email protected]> Sent: Monday, November 14, 2011 4:18:26 PM Subject: Re: Building KARs with karaf-maven-plugin 3.0.0-SNAPSHOT My personal opinion is that support for wrap urls is not a good idea anywhere. If we are going to do something to support using non-bundles as input to the kar contents I would think the way to do it is to require a complete enough wrap url to do a good job, and turn the jar into a bundle on the way into the kar. thanks david jencks On Nov 14, 2011, at 1:06 PM, mgardiner wrote: > Hi All, > > I am trying to use the karaf-maven-plugin 3.0.0-SNAPSHOT to generate a > features.xml and bundle it into the KAR but I am seeing an issue for > non-bundles. It does generate a feature xml file but what I am noticing is > that none of the urls for non-bundles in the generated feature xml get > prefixed with a "wrap:" so when I deploy the kar to the deploy directory in > Karaf 2.2.4 it throws a BundleException. > > org.osgi.framework.BundleException: Jar is not a bundle, no > Bundle-SymbolicName > > As a work-around I explicity put "wrap:" prefix in front of the uri for the > non-bundles in an input feature xml and then I end up with two bundles being > defined in the output feature.xml. I can exclude the artifact in my pom.xml > in the dependency list but this does not always work for transient > dependencies. > > So how do I > > 1) Use the karaf-maven-plugin but not overwrite my manually created > feature.xml to build a KAR > or > 2) Use the karaf-maven-plugin to build a KAR that automatically generates > the feature xml with correctly prefixed uris that include the "wrap:" prefix > for non-bundles > > Thanks. > > -Mike- > > -- > View this message in context: > http://karaf.922171.n3.nabble.com/Building-KARs-with-karaf-maven-plugin-3-0-0-SNAPSHOT-tp3507984p3507984.html > > Sent from the Karaf - User mailing list archive at Nabble.com. If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/Building-KARs-with-karaf-maven-plugin-3-0-0-SNAPSHOT-tp3507984p3508018.html To start a new topic under Karaf - User, email [email protected] To unsubscribe from Karaf - User, click here . NAML ----- Mike Van (All links open in new tabs) Committer - Kalumet Atraxia Technologies NCI Inc Mike Van's Open Source Technologies Blog -- View this message in context: http://karaf.922171.n3.nabble.com/Building-KARs-with-karaf-maven-plugin-3-0-0-SNAPSHOT-tp3507984p3508043.html Sent from the Karaf - User mailing list archive at Nabble.com.
