You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Charlie Mordant <cm...@gmail.com> on 2014/06/11 23:02:47 UTC

Upgrading a bundle's import version

Hi Karaf community,

If as me you want to increase the range of some package import versions in
a bundle you're depending, you can use my Manifest import version updater:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.helpers.parent/net.osgiliath.helpers.manifest.transformer

Here's an example of usage in a pom (it'll convert a range for guava
packages from [13, 14) to [13,17]:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.framework/net.osgiliath.helpers.parent/net.osgiliath.wrappers/net.osgiliath.wrapper.swagger-jaxrs/pom.xml

Feel free to use, integrate it in any plugin...

It will also be on Maven Central in one or two weeks.

Best regards,

-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Upgrading a bundle's import version

Posted by Charlie Mordant <cm...@gmail.com>.
Hi Jean-Baptiste,

I tried the maven-shade-plugin transformer too, but as my bundle was
included in a feature, karaf complained that MANIFEST.MF was not the first
resource of the generated jar (however, I could use
http://grep.codeconsult.ch/2011/11/15/manifest-mf-must-be-the-first-resource-in-a-jar-file-heres-how-to-fix-broken-jars/
to fix it).

The drawback with using wrap is that you've to recopy the entire old
manifest import package section on your URL (and it could be tedious also
not really readable).

Regards,
Charlie



2014-06-12 6:52 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Hi Charlie,
>
> You can use wrap: with Import-Package statement directly in URL.
>
> Like this, you can do this "on the fly", without changing the existing
> bundle, and without creating a new artifact.
>
> More over, this kind of transformer already exist for the shade plugin.
> It's what I use in ServiceMix bundle for elasticsearch for instance:
>
>                             <transformers>
>                                 <transformer implementation="org.apache.
> maven.plugins.shade.resource.ServicesResourceTransformer"/>
>                             </transformers>
>
> Here it's the ServicesResourceTransformer, but you can provide your own
> transformer.
>
> Regards
> JB
>
>
> On 06/11/2014 11:02 PM, Charlie Mordant wrote:
>
>> Hi Karaf community,
>>
>> If as me you want to increase the range of some package import versions
>> in a bundle you're depending, you can use my Manifest import version
>> updater:
>> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/
>> net.osgiliath.framework/net.osgiliath.helpers.parent/net.
>> osgiliath.helpers.manifest.transformer
>>
>> Here's an example of usage in a pom (it'll convert a range for guava
>> packages from [13, 14) to [13,17]:
>> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/
>> net.osgiliath.framework/net.osgiliath.helpers.parent/net.
>> osgiliath.wrappers/net.osgiliath.wrapper.swagger-jaxrs/pom.xml
>>
>> Feel free to use, integrate it in any plugin...
>>
>> It will also be on Maven Central in one or two weeks.
>>
>> Best regards,
>>
>> --
>> Charlie Mordant
>>
>> Full OSGI/EE stack made with Karaf:
>> https://github.com/OsgiliathEnterprise/net.osgiliath.parent
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Upgrading a bundle's import version

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Charlie,

You can use wrap: with Import-Package statement directly in URL.

Like this, you can do this "on the fly", without changing the existing 
bundle, and without creating a new artifact.

More over, this kind of transformer already exist for the shade plugin.
It's what I use in ServiceMix bundle for elasticsearch for instance:

                             <transformers>
                                 <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                             </transformers>

Here it's the ServicesResourceTransformer, but you can provide your own 
transformer.

Regards
JB

On 06/11/2014 11:02 PM, Charlie Mordant wrote:
> Hi Karaf community,
>
> If as me you want to increase the range of some package import versions
> in a bundle you're depending, you can use my Manifest import version
> updater:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.framework/net.osgiliath.helpers.parent/net.osgiliath.helpers.manifest.transformer
>
> Here's an example of usage in a pom (it'll convert a range for guava
> packages from [13, 14) to [13,17]:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.framework/net.osgiliath.helpers.parent/net.osgiliath.wrappers/net.osgiliath.wrapper.swagger-jaxrs/pom.xml
>
> Feel free to use, integrate it in any plugin...
>
> It will also be on Maven Central in one or two weeks.
>
> Best regards,
>
> --
> Charlie Mordant
>
> Full OSGI/EE stack made with Karaf:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com