You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Yuri de Wit <yd...@gmail.com> on 2011/04/23 07:47:43 UTC

bundle:bundleall questions

I am running bundle:bundleall and I am seeing:
 * more dependencies bundled than what is reported by dependency:tree
 * WARNINGS on dependencies that I explicitly excluded in my parent
pom dependencyManagement (same happening when I add the exclusions
clause to the project pom)
 * bundles are created in ${basedir}/target/classes: shouldn't they be
created somewhere else (e.g. ${basedir}/target/bundles)?

Any ideas?


Here is the result of dependency:tree:

[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ peaberry.servlet ---
[INFO] com.me:peaberry.servlet:jar:0.1.0-SNAPSHOT
[INFO] +- org.ops4j:peaberry:jar:1.2-SNAPSHOT:compile
[INFO] +- org.ops4j.peaberry.extensions:peaberry.activation:jar:1.2-SNAPSHOT:compile
[INFO] |  \- org.osgi:org.osgi.compendium:jar:4.2.0:compile
[INFO] +- org.apache.felix:de.kalpatec.pojosr.framework:jar:0.1.1-SNAPSHOT:compile
[INFO] |  \- org.osgi:org.osgi.core:jar:4.2.0:compile
[INFO] +- com.google.inject:guice:jar:3.0:compile
[INFO] |  +- javax.inject:javax.inject:jar:1:compile
[INFO] |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- ch.qos.logback:logback-classic:jar:0.9.28:test
[INFO] |  +- ch.qos.logback:logback-core:jar:0.9.28:test
[INFO] |  \- org.slf4j:slf4j-api:jar:1.6.1:test
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] \- org.hamcrest:hamcrest-all:jar:1.1:test

And here is the result of invoking bundle:bundleall:

[INFO] --- maven-bundle-plugin:2.3.4:bundleall (default-cli) @
peaberry.servlet ---
[INFO] Bundling aopalliance:aopalliance:jar:1.0:compile
[INFO] Bundling javax.inject:javax.inject:jar:1:compile
[INFO] Bundling asm:asm:jar:3.1:compile
[INFO] Bundling org.apache.ant:ant-launcher:jar:1.8.1:compile
[INFO] Bundling org.apache.ant:ant:jar:1.8.1:compile
[INFO] Bundling asm:asm-tree:jar:3.1:compile
[INFO] Bundling asm:asm-util:jar:3.1:compile
[INFO] Bundling org.sonatype.sisu.inject:cglib:jar:2.2.1-v20090111:compile
[WARNING] Ignoring artifact due to dependency cycle
aopalliance:aopalliance:jar:1.0:compile
[WARNING] Ignoring artifact due to dependency cycle
javax.inject:javax.inject:jar:1:compile
[INFO] Bundling com.google.inject:guice:jar:3.0:compile
[INFO] Using existing OSGi bundle for com.google.inject:guice:3.0
[INFO] Bundling org.osgi:org.osgi.core:jar:4.2.0:compile
[INFO] Using existing OSGi bundle for org.osgi:org.osgi.core:4.2.0
[INFO] Bundling org.osgi:org.osgi.compendium:jar:4.2.0:compile
[INFO] Using existing OSGi bundle for org.osgi:org.osgi.compendium:4.2.0
[INFO] Bundling
org.apache.felix:de.kalpatec.pojosr.framework:jar:0.1.1-SNAPSHOT:compile
[INFO] Using existing OSGi bundle for
org.apache.felix:de.kalpatec.pojosr.framework:0.1.1-SNAPSHOT
[INFO] Bundling
org.ops4j.peaberry.dependencies:javax.inject:jar:1.0-SNAPSHOT:compile
[INFO] Using existing OSGi bundle for
org.ops4j.peaberry.dependencies:javax.inject:1.0-SNAPSHOT
[INFO] Bundling
org.ops4j.peaberry.dependencies:aopalliance:jar:1.0-SNAPSHOT:compile
[INFO] Using existing OSGi bundle for
org.ops4j.peaberry.dependencies:aopalliance:1.0-SNAPSHOT
[INFO] Bundling asm:asm:jar:3.3.1:compile
[INFO] Bundling org.ops4j:peaberry:jar:1.2-SNAPSHOT:compile
[INFO] Using existing OSGi bundle for org.ops4j:peaberry:1.2-SNAPSHOT
[INFO] Bundling
org.ops4j.peaberry.extensions:peaberry.activation:jar:1.2-SNAPSHOT:compile
[INFO] Using existing OSGi bundle for
org.ops4j.peaberry.extensions:peaberry.activation:1.2-SNAPSHOT
[WARNING] Package org.aopalliance.intercept is exported in more than a bundle:
[WARNING]   org.ops4j.peaberry.dependencies:aopalliance:jar:1.0-SNAPSHOT:compile
[WARNING]   aopalliance:aopalliance:jar:1.0:compile
[WARNING] Package org.aopalliance.aop is exported in more than a bundle:
[WARNING]   org.ops4j.peaberry.dependencies:aopalliance:jar:1.0-SNAPSHOT:compile
[WARNING]   aopalliance:aopalliance:jar:1.0:compile
[WARNING] Package javax.inject is exported in more than a bundle:
[WARNING]   org.ops4j.peaberry.dependencies:javax.inject:jar:1.0-SNAPSHOT:compile
[WARNING]   javax.inject:javax.inject:jar:1:compile

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bundle:bundleall questions

Posted by Stuart McCulloch <mc...@gmail.com>.
On 23 April 2011 06:47, Yuri de Wit <yd...@gmail.com> wrote:

> I am running bundle:bundleall and I am seeing:
>

IMHO the bundleall goal is not really recommended for the issues you mention
below, as well as the following reasons:

  1)  the default metadata ignores best practice (ie. it exports packages
using the bundle version)

  2)  you can't customize the bundle metadata per-artifact

  3)  you end up with a lot of duplicate jars not tied to the Maven project
- so they aren't deployed

  4)  and because they aren't tied to the project, you can't benefit from
other Maven-based OSGi tools

  5)  ...even if they were attached they'd have to share the GAV and use
classifiers to disambiguate

There are also better ways to convert bundles, such as using URL wrappers
like Pax URL to dynamically turn artifacts into bundles - that way you can
continue to use the original artifact (and GAV co-ordinates) and customize
the metadata per-artifact. You could also think about creating a
"mega-bundle" that includes all the various non-bundles, which may make
sense if they're related - then later on split this up into separate Maven
projects.

In fact I'm wondering whether we should really think about deprecating this
goal, because I do believe it does lead to poor bundles - what do others
think?

PS. I'm not against keeping it around if people provide patches to improve
it, but I don't really intend to actively work on the bundleall goal myself

 * more dependencies bundled than what is reported by dependency:tree
>  * WARNINGS on dependencies that I explicitly excluded in my parent
> pom dependencyManagement (same happening when I add the exclusions
> clause to the project pom)
>  * bundles are created in ${basedir}/target/classes: shouldn't they be
> created somewhere else (e.g. ${basedir}/target/bundles)?
>
> Any ideas?
>
>
> Here is the result of dependency:tree:
>
> [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @
> peaberry.servlet ---
> [INFO] com.me:peaberry.servlet:jar:0.1.0-SNAPSHOT
> [INFO] +- org.ops4j:peaberry:jar:1.2-SNAPSHOT:compile
> [INFO] +-
> org.ops4j.peaberry.extensions:peaberry.activation:jar:1.2-SNAPSHOT:compile
> [INFO] |  \- org.osgi:org.osgi.compendium:jar:4.2.0:compile
> [INFO] +-
> org.apache.felix:de.kalpatec.pojosr.framework:jar:0.1.1-SNAPSHOT:compile
> [INFO] |  \- org.osgi:org.osgi.core:jar:4.2.0:compile
> [INFO] +- com.google.inject:guice:jar:3.0:compile
> [INFO] |  +- javax.inject:javax.inject:jar:1:compile
> [INFO] |  \- aopalliance:aopalliance:jar:1.0:compile
> [INFO] +- javax.servlet:servlet-api:jar:2.5:provided
> [INFO] +- junit:junit:jar:4.8.2:test
> [INFO] +- ch.qos.logback:logback-classic:jar:0.9.28:test
> [INFO] |  +- ch.qos.logback:logback-core:jar:0.9.28:test
> [INFO] |  \- org.slf4j:slf4j-api:jar:1.6.1:test
> [INFO] +- org.mockito:mockito-all:jar:1.8.5:test
> [INFO] \- org.hamcrest:hamcrest-all:jar:1.1:test
>
> And here is the result of invoking bundle:bundleall:
>
> [INFO] --- maven-bundle-plugin:2.3.4:bundleall (default-cli) @
> peaberry.servlet ---
> [INFO] Bundling aopalliance:aopalliance:jar:1.0:compile
> [INFO] Bundling javax.inject:javax.inject:jar:1:compile
> [INFO] Bundling asm:asm:jar:3.1:compile
> [INFO] Bundling org.apache.ant:ant-launcher:jar:1.8.1:compile
> [INFO] Bundling org.apache.ant:ant:jar:1.8.1:compile
> [INFO] Bundling asm:asm-tree:jar:3.1:compile
> [INFO] Bundling asm:asm-util:jar:3.1:compile
> [INFO] Bundling org.sonatype.sisu.inject:cglib:jar:2.2.1-v20090111:compile
> [WARNING] Ignoring artifact due to dependency cycle
> aopalliance:aopalliance:jar:1.0:compile
> [WARNING] Ignoring artifact due to dependency cycle
> javax.inject:javax.inject:jar:1:compile
> [INFO] Bundling com.google.inject:guice:jar:3.0:compile
> [INFO] Using existing OSGi bundle for com.google.inject:guice:3.0
> [INFO] Bundling org.osgi:org.osgi.core:jar:4.2.0:compile
> [INFO] Using existing OSGi bundle for org.osgi:org.osgi.core:4.2.0
> [INFO] Bundling org.osgi:org.osgi.compendium:jar:4.2.0:compile
> [INFO] Using existing OSGi bundle for org.osgi:org.osgi.compendium:4.2.0
> [INFO] Bundling
> org.apache.felix:de.kalpatec.pojosr.framework:jar:0.1.1-SNAPSHOT:compile
> [INFO] Using existing OSGi bundle for
> org.apache.felix:de.kalpatec.pojosr.framework:0.1.1-SNAPSHOT
> [INFO] Bundling
> org.ops4j.peaberry.dependencies:javax.inject:jar:1.0-SNAPSHOT:compile
> [INFO] Using existing OSGi bundle for
> org.ops4j.peaberry.dependencies:javax.inject:1.0-SNAPSHOT
> [INFO] Bundling
> org.ops4j.peaberry.dependencies:aopalliance:jar:1.0-SNAPSHOT:compile
> [INFO] Using existing OSGi bundle for
> org.ops4j.peaberry.dependencies:aopalliance:1.0-SNAPSHOT
> [INFO] Bundling asm:asm:jar:3.3.1:compile
> [INFO] Bundling org.ops4j:peaberry:jar:1.2-SNAPSHOT:compile
> [INFO] Using existing OSGi bundle for org.ops4j:peaberry:1.2-SNAPSHOT
> [INFO] Bundling
> org.ops4j.peaberry.extensions:peaberry.activation:jar:1.2-SNAPSHOT:compile
> [INFO] Using existing OSGi bundle for
> org.ops4j.peaberry.extensions:peaberry.activation:1.2-SNAPSHOT
> [WARNING] Package org.aopalliance.intercept is exported in more than a
> bundle:
> [WARNING]
> org.ops4j.peaberry.dependencies:aopalliance:jar:1.0-SNAPSHOT:compile
> [WARNING]   aopalliance:aopalliance:jar:1.0:compile
> [WARNING] Package org.aopalliance.aop is exported in more than a bundle:
> [WARNING]
> org.ops4j.peaberry.dependencies:aopalliance:jar:1.0-SNAPSHOT:compile
> [WARNING]   aopalliance:aopalliance:jar:1.0:compile
> [WARNING] Package javax.inject is exported in more than a bundle:
> [WARNING]
> org.ops4j.peaberry.dependencies:javax.inject:jar:1.0-SNAPSHOT:compile
> [WARNING]   javax.inject:javax.inject:jar:1:compile
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

-- 
Cheers, Stuart