On 6 Mar 2012, at 14:38, Thomas GILLET wrote:

> Hello,
> 
> Using maven-bundle-plugin 2.3.6, I need to include in my bundle some classes
> from a library.
> I did it by adding this line in the plugin configuration:
> 
>    <Private-Package>mypackageroot.impl.*,
> mylibrarypackage.*</Private-Package>
> 
> But that means I must explicitly list "mypackageroot.impl.*" in my POM,
> which I was avoiding before by using the default values and the
> .impl/.internal naming convention for private packages.
> 
> So, as Export-Package has its default value accessible through
> {local-packages}

Actually {local-packages} is always mapped to the appropriate value - when you 
use it inside Export-Package it is replaced by the list of all local 
non-impl/non-internal packages, and when you use it inside Private-Package it 
is replaced by the list of all local packages. Note that packages that appear 
in both Export-Package and Private-Package are exported (ie. export wins).

So to add a (private) package from another dependency just use:

   <Private-Package>{local-packages},mylibrarypackage.*</Private-Package>

Alternatively you can also use Embed-Dependency to inline the dependency:

   <Embed-Dependency>myArtifactId;inline=true</Embed-Dependency>

or even inline specific resources/classes from the dependency:

   <Embed-Dependency>myArtifactId;inline=my/library/pkg/**</Embed-Dependency>

HTH

> , is it possible to access the Private-Package default? some
> kind of {private-local-packages} macro or something?
> 
> NB: I actually found a workaround while writing this message, but I'm still
> curious about accessing the default value of Private-Package.
> (The workaround is: use the Conditional-Package header.)
> 
> NB2: I just realized I could use the default value of Bundle-SymbolicName as
> well (since it's smartly computed from groupId and artifactId). Maybe this
> should be a more general wondering about how to access the default value of
> any header or directive...
> 
> -- 
> View this message in context: 
> http://old.nabble.com/maven-bundle-plugin-%3A-%7Blocal-packages%7D-and-Private-Package-tp33451277p33451277.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to