You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Sahoo <sa...@sun.com> on 2008/07/11 18:10:40 UTC
[maven-bundle-plugin] _exportcontents=* together with inline=true
Let's say I want to wrap a few library jars as a single bundle and I
want to export all packages in all those libraries. I want to inline the
contents. Can I configure maven-bundle-plugin like this:
<instructions>
<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
<_exportcontents>*</_exportcontents>
</instructions>
Or, do I have to specify the package patterns using Export-Package?
Thanks,
Sahoo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: [maven-bundle-plugin] _exportcontents=* together with inline=true
Posted by Stuart McCulloch <st...@jayway.net>.
2008/7/12 Sahoo <sa...@sun.com>:
> Let's say I want to wrap a few library jars as a single bundle and I want
> to export all packages in all those libraries. I want to inline the
> contents. Can I configure maven-bundle-plugin like this:
> <instructions>
> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>
> <_exportcontents>*</_exportcontents>
> </instructions>
>
correct, I also set Private-Package to be "!*" as a temporary workaround for
an
issue that's fixed in trunk (to do with the defaults when using
exportcontents)
<instructions>
<Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
<_exportcontents>*</_exportcontents>
<Private-Package>!*</Private-Package>
</instructions>
but that workaround is no longer required when using 1.4.2-SNAPSHOT
Or, do I have to specify the package patterns using Export-Package?
>
no need - setting Export-Package will basically duplicate the inlining
because
that tells Bnd to pull in all classes from the classpath (including
dependencies)
but you're already inlining these classes via the Embed-Dependency.
in summary:
<Export-Package> will pull packages into the bundle and mark them as
exported
<_exportcontents> marks exported packages without changing the bundle
contents
btw <_exportcontents> is very useful when wrapping because you can add the
wrapped jar using Embed-Dependency and export its contents - without pulling
in any transitive dependencies, as only the direct dependency is embedded
whereas if you used <Export-Package>*</Export-Package> then you'd also get
the transitive dependencies, because they are on the compilation
classpath...
ps, this is the approach we use in the "pax-wrap-jar" script:
http://www.ops4j.org/projects/pax/construct/help/wrap-jar.html
HTH
Thanks,
> Sahoo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
--
Cheers, Stuart