Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » OSGi vs Maven version numbers
OSGi vs Maven version numbers [message #698401] Tue, 19 July 2011 12:30 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Hello.

I am not sure if this is the right forum for this question; if it is not, could you please point me to the right place.

I am currently developing my Virgo based app with Maven and Bundlor. There is a discrepancy between OSGi's idea of a correct version number (ex. 1.0.0.SNAPSHOT) and Maven's (ex. 1.0.0-SNAPSHOT).

I know that the Apache's BND tool automatically manages the dynamic conversion between the two version styles, but this does not appear to be true for Bundlor.

Any idea as to how to manage this?

TIA,
B.
Re: OSGi vs Maven version numbers [message #698444 is a reply to message #698401] Tue, 19 July 2011 13:41 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 273
Registered: January 2010
Senior Member
In maven use:

1.0.0.BUILD-SNAPSHOT

or something similar. i.e. instead of "BUILD" you can use "DEV" or a branch name in SCM.

This way you will satisfy both maters Smile
Re: OSGi vs Maven version numbers [message #698478 is a reply to message #698444] Tue, 19 July 2011 14:34 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Thanks Dmitry.

I should have actually been more specific. We currently have a Maven savvy release tool which manages all the company's projects, which are not OSGi ones. The tool automatically drops the "-SNAPSHOT" suffix when creating releases to the production environment and it also manages automatic increment of the version numbers.

As such, our OSGi project ought to maintain the 1.0.0-SNAPSHOT convention in order not to break the release tool. Is this possible?

Someone suggested to use something like 1.1.0-SNAPSHOT, where the qualifier in the OSGi sense would be the entire substring "0-SNAPSHOT" and the autoIncremented version number would be the second digit, but is that acceptable?

Thanks again,
B.
Re: OSGi vs Maven version numbers [message #698490 is a reply to message #698478] Tue, 19 July 2011 14:56 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
OSGi will always interpret a version of 1.1.0-SNAPSHOT to be invalid because the form major.minor.micro.qualifier cannot have a qualifier without both a micro and a '.' between the micro and the qualifier.

The OSGi Alliance are looking at this and have some ideas for a future release, but for now we are stuck with the n.n.n.xxx... format for qualified version numbers.

[Updated on: Tue, 19 July 2011 14:56]

Report message to a moderator

Re: OSGi vs Maven version numbers [message #698503 is a reply to message #698490] Tue, 19 July 2011 15:09 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Thanks Glyn.

I can see how Dmitry's solution could work as an alternative.

[Updated on: Tue, 19 July 2011 15:11]

Report message to a moderator

Re: OSGi vs Maven version numbers [message #698506 is a reply to message #698503] Tue, 19 July 2011 15:13 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
I guess so. Dmitry, unlike me, understands Maven.
Re: OSGi vs Maven version numbers [message #698510 is a reply to message #698503] Tue, 19 July 2011 15:15 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 273
Registered: January 2010
Senior Member
You could use a property in the pom file that defines the osgi version of the bundle and pass it to the bundlor plugin. This way the ${project.version} and ${project.osgi.version} could be used. One will follow the maven convention and other will follow osgi convention.
Re: OSGi vs Maven version numbers [message #698513 is a reply to message #698510] Tue, 19 July 2011 15:19 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Excellent, thanks to both of you!

But if I do what you suggest, Dmitry, then my ${project.version} and ${project.osgi.version} could be anything I like, correct?

[Updated on: Tue, 19 July 2011 15:20]

Report message to a moderator

Re: OSGi vs Maven version numbers [message #698530 is a reply to message #698513] Tue, 19 July 2011 15:50 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 273
Registered: January 2010
Senior Member
Your project version corresponds to the value defined in the <version/> element of the pom. project.osgi.version should be defined in the <properties><project.osgi.version>...</properties> section.
So yes , it can be anything as long as it satisfies osgi versioning schema or major.minor.micro.qualifier.

Re: OSGi vs Maven version numbers [message #699775 is a reply to message #698530] Fri, 22 July 2011 09:38 Go to previous message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Understood, thank you Dmitry!
Previous Topic:change initialArtifacts property via command line
Next Topic:dispatcher inside snap not finding path.
Goto Forum:
  


Current Time: Thu Oct 30 19:04:57 GMT 2014

Powered by FUDForum. Page generated in 0.03840 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software