You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Thomas GILLET <th...@consultant.volvo.com> on 2012/03/06 15:38:36 UTC
maven-bundle-plugin : {local-packages} and Private-Package
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}, 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: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: maven-bundle-plugin : {local-packages} and Private-Package
Posted by Stuart McCulloch <mc...@gmail.com>.
On 6 Mar 2012, at 16:46, Thomas GILLET wrote:
> Ok, so {local-packages} is not just some kind of property, it's
> context-dependent. Now I understand.
>
> By the way, {local-packages} inside Private-Package seems to work only since
> 2.3.6, but I do not see anything about that in the release notes. (I was
> actually using 2.3.4 and not 2.3.6 as I said before, hence my problem.)
Yes, the default handling was improved as part of FELIX-3238 in 2.3.6 - see https://issues.apache.org/jira/browse/FELIX-3238#comment-13158471
> Thanks for the quick help.
> --
> View this message in context: http://old.nabble.com/maven-bundle-plugin-%3A-%7Blocal-packages%7D-and-Private-Package-tp33451277p33452240.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: maven-bundle-plugin : {local-packages} and Private-Package
Posted by Thomas GILLET <th...@consultant.volvo.com>.
Ok, so {local-packages} is not just some kind of property, it's
context-dependent. Now I understand.
By the way, {local-packages} inside Private-Package seems to work only since
2.3.6, but I do not see anything about that in the release notes. (I was
actually using 2.3.4 and not 2.3.6 as I said before, hence my problem.)
Thanks for the quick help.
--
View this message in context: http://old.nabble.com/maven-bundle-plugin-%3A-%7Blocal-packages%7D-and-Private-Package-tp33451277p33452240.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: maven-bundle-plugin : {local-packages} and Private-Package
Posted by Stuart McCulloch <mc...@gmail.com>.
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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org