You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Charles Moulliard <ch...@gmail.com> on 2015/01/30 12:32:27 UTC

Strange issue with Maven Bundle Plugin

Hi,

Since maven-bundle-plugin (2.3.7) some packages declared as optional are
removed by the plugin or bnd tool when the MANIFEST is created.

Example :

<Import-Package>*,=org.jbpm.services.task*;resolution:=optional,*org.jbpm.persistence.correlation*;resolution:=optional</Import-Package>

The trick is to place the symbol '=' before the line like that
'=org.jbpm*;resolution=optional' but this option does not work with OPS4J
PAX url tool (= wrap)

<bundle
start-level="100">wrap:mvn:org.hibernate/hibernate-core/4.3.1.Final$overwrite=merge&amp;Import-Package=*,=org.jbpm.services.task*;resolution:=optional,*org.jbpm.persistence.correlation*;resolution:=optional</bundle>

QUESTOS :

- Is there a reason why this behavior has changed (optional packages
removed) ?

-  Is there another trick to be used instead of the symbol '=' avoid that
the packages are removed ?
Regards,

-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Re: Strange issue with Maven Bundle Plugin

Posted by Charles Moulliard <ch...@gmail.com>.
Here is an example of a project where we have been obliged to use the '='
symbol

https://github.com/droolsjbpm/drools/blob/master/drools-compiler/pom.xml#L243-L264

On Fri, Jan 30, 2015 at 12:48 PM, Stuart McCulloch <mc...@gmail.com>
wrote:

> Also are the asterisks in your import-package like that in the actual
> file? They look odd since usually you should have the catch-all wildcard at
> the end rather than the start.
>
> On Friday, 30 January 2015 at 11:44, Stuart McCulloch wrote:
>
> > I have various local projects with explicitly declared optional imports
> and they all appear in the manifest, so you’ll need to provide a test
> project that demonstrates the issue.
> >
> > Note that since 2.3.7 there have been numerous changes to both the
> default instructions generated by the plugin and the version of bndlib used
> to generate the metadata
> >
> > On Friday, 30 January 2015 at 11:32, Charles Moulliard wrote:
> >
> > > Hi,
> > >
> > > Since maven-bundle-plugin (2.3.7) some packages declared as optional
> are
> > > removed by the plugin or bnd tool when the MANIFEST is created.
> > >
> > > Example :
> > >
> > >
> <Import-Package>*,=org.jbpm.services.task*;resolution:=optional,*org.jbpm.persistence.correlation*;resolution:=optional</Import-Package>
> > >
> > > The trick is to place the symbol '=' before the line like that
> > > '=org.jbpm*;resolution=optional' but this option does not work with
> OPS4J
> > > PAX url tool (= wrap)
> > >
> > > <bundle
> > >
> start-level="100">wrap:mvn:org.hibernate/hibernate-core/4.3.1.Final$overwrite=merge&amp;Import-Package=*,=org.jbpm.services.task*;resolution:=optional,*org.jbpm.persistence.correlation*;resolution:=optional</bundle>
> > >
> > > QUESTOS :
> > >
> > > - Is there a reason why this behavior has changed (optional packages
> > > removed) ?
> > >
> > > - Is there another trick to be used instead of the symbol '=' avoid
> that
> > > the packages are removed ?
> > > Regards,
> > >
> > > --
> > > Charles Moulliard
> > > Apache Committer / Architect @RedHat
> > > Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
> > >
> > >
> > >
> >
> >
>
>


-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Re: Strange issue with Maven Bundle Plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
Also are the asterisks in your import-package like that in the actual file? They look odd since usually you should have the catch-all wildcard at the end rather than the start.

On Friday, 30 January 2015 at 11:44, Stuart McCulloch wrote:

> I have various local projects with explicitly declared optional imports and they all appear in the manifest, so you’ll need to provide a test project that demonstrates the issue.
>  
> Note that since 2.3.7 there have been numerous changes to both the default instructions generated by the plugin and the version of bndlib used to generate the metadata  
>  
> On Friday, 30 January 2015 at 11:32, Charles Moulliard wrote:
>  
> > Hi,
> >  
> > Since maven-bundle-plugin (2.3.7) some packages declared as optional are
> > removed by the plugin or bnd tool when the MANIFEST is created.
> >  
> > Example :
> >  
> > <Import-Package>*,=org.jbpm.services.task*;resolution:=optional,*org.jbpm.persistence.correlation*;resolution:=optional</Import-Package>
> >  
> > The trick is to place the symbol '=' before the line like that
> > '=org.jbpm*;resolution=optional' but this option does not work with OPS4J
> > PAX url tool (= wrap)
> >  
> > <bundle
> > start-level="100">wrap:mvn:org.hibernate/hibernate-core/4.3.1.Final$overwrite=merge&amp;Import-Package=*,=org.jbpm.services.task*;resolution:=optional,*org.jbpm.persistence.correlation*;resolution:=optional</bundle>
> >  
> > QUESTOS :
> >  
> > - Is there a reason why this behavior has changed (optional packages
> > removed) ?
> >  
> > - Is there another trick to be used instead of the symbol '=' avoid that
> > the packages are removed ?
> > Regards,
> >  
> > --  
> > Charles Moulliard
> > Apache Committer / Architect @RedHat
> > Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
> >  
> >  
> >  
>  
>  


Re: Strange issue with Maven Bundle Plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
I have various local projects with explicitly declared optional imports and they all appear in the manifest, so you’ll need to provide a test project that demonstrates the issue.

Note that since 2.3.7 there have been numerous changes to both the default instructions generated by the plugin and the version of bndlib used to generate the metadata  

On Friday, 30 January 2015 at 11:32, Charles Moulliard wrote:

> Hi,
>  
> Since maven-bundle-plugin (2.3.7) some packages declared as optional are
> removed by the plugin or bnd tool when the MANIFEST is created.
>  
> Example :
>  
> <Import-Package>*,=org.jbpm.services.task*;resolution:=optional,*org.jbpm.persistence.correlation*;resolution:=optional</Import-Package>
>  
> The trick is to place the symbol '=' before the line like that
> '=org.jbpm*;resolution=optional' but this option does not work with OPS4J
> PAX url tool (= wrap)
>  
> <bundle
> start-level="100">wrap:mvn:org.hibernate/hibernate-core/4.3.1.Final$overwrite=merge&amp;Import-Package=*,=org.jbpm.services.task*;resolution:=optional,*org.jbpm.persistence.correlation*;resolution:=optional</bundle>
>  
> QUESTOS :
>  
> - Is there a reason why this behavior has changed (optional packages
> removed) ?
>  
> - Is there another trick to be used instead of the symbol '=' avoid that
> the packages are removed ?
> Regards,
>  
> --  
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>  
>