You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Tommaso Teofili <to...@gmail.com> on 2011/05/16 17:23:18 UTC

osgi version within Maven Bundle plugin

Hi all,
I'm working on the new RC for UIMA Addons, but I'm stuck with an issue with
the addons-osgi-runtime.
In fact when I run the release:prepare (dryRun) the osgiVersion property set
in addons-osgi-runtime POM doesn't get automatically changed from
2.3.1.SNAPSHOT to 2.3.1 automatically.
So, after spending some time looking at different ways of automate that with
Maven, it seemed to me the build-helper-plugin could be the right choice as
it provides an OSGi compliant version naming one can use in the artifact
finalName [1].
Now the issue is that the Maven Bundle plugin seem to not care about the
parsedVersion.osgiVersion property generated by the build-helper and I see
someone already faced the same problem [2].
I see in uimaj-ep-runtime this was resolved changing the packaging type from
bundle to jar and using the maven-dependency-plugin to assembly the
dependencies' classes inside the bundle but it seems to me a bit "dirty" so
I wonder if anyone has a better suggestion.
This all is for having a "smart" way of updating the version, the non-smart
way is I can always change the osgiVersion property to 2.3.1 before
preparing the release manually and eventually reverting it if the release
has to be rolled back.
Any feedback is appreciated.
Tommaso


[1] :
http://mojo.codehaus.org/build-helper-maven-plugin/parse-version-mojo.html
[2] : http://markmail.org/thread/mauukht3nyphuj6z

Re: osgi version within Maven Bundle plugin

Posted by Tommaso Teofili <to...@gmail.com>.
Hello all,
I've committed some changes to addons-osgi-runtime, it seems to me that the
generated bundles have now proper version numbering and run flawlessly in an
OSGi container (I've tested them within Apache Felix).
If anyone has any (additional) suggestion on how to improve it please let me
know.
Tommaso

2011/5/17 Tommaso Teofili <to...@gmail.com>

> 2011/5/17 Marshall Schor <ms...@schor.com>
>
>>
>> Oh, sorry, I missed that detail ...
>>
>> The OSGi version of the project.version is made available in the variable:
>>
>> ${parsedVersion.osgiVersion}
>>
>> Can you use that?  This is provided by the build-helper maven plugin,
>> which is
>> already being run as part of our builds (see lines 571-583 in version 2 of
>> the
>> uima overall parent pom).
>>
>>
> I tried to use that but with the <packaging>bundle</pacakging> setting it
> doesn't seem to work so the property isn't correctly substituted. Now I am
> trying the <packaging>jar</packaging> configuration (like in
> uimaj-ep-runtime pom).
> Will let you know.
> Tommaso
>

Re: osgi version within Maven Bundle plugin

Posted by Tommaso Teofili <to...@gmail.com>.
2011/5/17 Marshall Schor <ms...@schor.com>

>
> Oh, sorry, I missed that detail ...
>
> The OSGi version of the project.version is made available in the variable:
>
> ${parsedVersion.osgiVersion}
>
> Can you use that?  This is provided by the build-helper maven plugin, which
> is
> already being run as part of our builds (see lines 571-583 in version 2 of
> the
> uima overall parent pom).
>
>
I tried to use that but with the <packaging>bundle</pacakging> setting it
doesn't seem to work so the property isn't correctly substituted. Now I am
trying the <packaging>jar</packaging> configuration (like in
uimaj-ep-runtime pom).
Will let you know.
Tommaso

Re: osgi version within Maven Bundle plugin

Posted by Marshall Schor <ms...@schor.com>.

On 5/17/2011 3:07 AM, Tommaso Teofili wrote:
> 2011/5/16 Marshall Schor <ms...@schor.com>
>
>>
>> On 5/16/2011 11:23 AM, Tommaso Teofili wrote:
>>> Hi all,
>>> I'm working on the new RC for UIMA Addons, but I'm stuck with an issue
>> with
>>> the addons-osgi-runtime.
>>> In fact when I run the release:prepare (dryRun) the osgiVersion property
>> set
>>> in addons-osgi-runtime POM doesn't get automatically changed from
>>> 2.3.1.SNAPSHOT to 2.3.1 automatically.
>> Would this work: changed the definition of that property to
>> <osgiVersion>${project.version}</osgiVersion>  ?
>>
> the problem is that 2.3.1-SNAPSHOT is not a "valid" OSGi version and it
> should be converted to 2.3.1.SNAPSHOT (this is not a problem for the release
> but for the current/next snapshot versioning)

Oh, sorry, I missed that detail ...

The OSGi version of the project.version is made available in the variable:

${parsedVersion.osgiVersion}

Can you use that?  This is provided by the build-helper maven plugin, which is
already being run as part of our builds (see lines 571-583 in version 2 of the
uima overall parent pom).

-Marshall

>
>>
>>> So, after spending some time looking at different ways of automate that
>> with
>>> Maven, it seemed to me the build-helper-plugin could be the right choice
>> as
>>> it provides an OSGi compliant version naming one can use in the artifact
>>> finalName [1].
>>> Now the issue is that the Maven Bundle plugin seem to not care about the
>>> parsedVersion.osgiVersion property generated by the build-helper and I
>> see
>>> someone already faced the same problem [2].
>>> I see in uimaj-ep-runtime this was resolved changing the packaging type
>> from
>>> bundle to jar and using the maven-dependency-plugin to assembly the
>>> dependencies' classes inside the bundle but it seems to me a bit "dirty"
>> so
>>> I wonder if anyone has a better suggestion.
>> The "Jar" packaging also makes the standard part of our build that adds
>> license,
>> notice, etc. to the jars, work.  I think I remember this layout may not be
>> done
>> with "Bundle" packaging.
>>
> Ok, will spend some time trying out with the jar packaging.
> Thanks,
> Tommaso
>

Re: osgi version within Maven Bundle plugin

Posted by Tommaso Teofili <to...@gmail.com>.
2011/5/16 Marshall Schor <ms...@schor.com>

>
>
> On 5/16/2011 11:23 AM, Tommaso Teofili wrote:
> > Hi all,
> > I'm working on the new RC for UIMA Addons, but I'm stuck with an issue
> with
> > the addons-osgi-runtime.
> > In fact when I run the release:prepare (dryRun) the osgiVersion property
> set
> > in addons-osgi-runtime POM doesn't get automatically changed from
> > 2.3.1.SNAPSHOT to 2.3.1 automatically.
>
> Would this work: changed the definition of that property to
> <osgiVersion>${project.version}</osgiVersion>  ?
>

the problem is that 2.3.1-SNAPSHOT is not a "valid" OSGi version and it
should be converted to 2.3.1.SNAPSHOT (this is not a problem for the release
but for the current/next snapshot versioning)


>
>
> > So, after spending some time looking at different ways of automate that
> with
> > Maven, it seemed to me the build-helper-plugin could be the right choice
> as
> > it provides an OSGi compliant version naming one can use in the artifact
> > finalName [1].
> > Now the issue is that the Maven Bundle plugin seem to not care about the
> > parsedVersion.osgiVersion property generated by the build-helper and I
> see
> > someone already faced the same problem [2].
> > I see in uimaj-ep-runtime this was resolved changing the packaging type
> from
> > bundle to jar and using the maven-dependency-plugin to assembly the
> > dependencies' classes inside the bundle but it seems to me a bit "dirty"
> so
> > I wonder if anyone has a better suggestion.
>
> The "Jar" packaging also makes the standard part of our build that adds
> license,
> notice, etc. to the jars, work.  I think I remember this layout may not be
> done
> with "Bundle" packaging.
>

Ok, will spend some time trying out with the jar packaging.
Thanks,
Tommaso

Re: osgi version within Maven Bundle plugin

Posted by Marshall Schor <ms...@schor.com>.

On 5/16/2011 11:23 AM, Tommaso Teofili wrote:
> Hi all,
> I'm working on the new RC for UIMA Addons, but I'm stuck with an issue with
> the addons-osgi-runtime.
> In fact when I run the release:prepare (dryRun) the osgiVersion property set
> in addons-osgi-runtime POM doesn't get automatically changed from
> 2.3.1.SNAPSHOT to 2.3.1 automatically.

Would this work: changed the definition of that property to
<osgiVersion>${project.version}</osgiVersion>  ?


> So, after spending some time looking at different ways of automate that with
> Maven, it seemed to me the build-helper-plugin could be the right choice as
> it provides an OSGi compliant version naming one can use in the artifact
> finalName [1].
> Now the issue is that the Maven Bundle plugin seem to not care about the
> parsedVersion.osgiVersion property generated by the build-helper and I see
> someone already faced the same problem [2].
> I see in uimaj-ep-runtime this was resolved changing the packaging type from
> bundle to jar and using the maven-dependency-plugin to assembly the
> dependencies' classes inside the bundle but it seems to me a bit "dirty" so
> I wonder if anyone has a better suggestion.

The "Jar" packaging also makes the standard part of our build that adds license,
notice, etc. to the jars, work.  I think I remember this layout may not be done
with "Bundle" packaging.

> This all is for having a "smart" way of updating the version, the non-smart
> way is I can always change the osgiVersion property to 2.3.1 before
> preparing the release manually and eventually reverting it if the release
> has to be rolled back.
> Any feedback is appreciated.
> Tommaso
>
>
> [1] :
> http://mojo.codehaus.org/build-helper-maven-plugin/parse-version-mojo.html
> [2] : http://markmail.org/thread/mauukht3nyphuj6z
>