Thanks, Thilo (and Adam), for explaining this.
I've discovered that the maven builder-helper plugin can parse the
version and create a bunch of properties, including osgiVersion - which
replaces the first "-" with a ".".
So here's the strategy I'm hoping will work:
1) have the maven version number for the project be x.y.z-SNAPSHOT for
instance, with the dash.
2) Have the POM set the final build artifact name to be x.y.z.SNAPSHOT
for instance, using the osgiVersion property.
-Marshall
On 5/3/2010 11:41 AM, Thilo Goetz wrote:
> That's a bundle identifier, such as org.apache.uima.core.
> I thought we were talking about version numbers. This is
> from the the OSGi javadocs:
>
> version ::= major('.'minor('.'micro('.'qualifier)?)?)?
> major ::= digit+
> minor ::= digit+
> micro ::= digit+
> qualifier ::= (alpha|digit|'_'|'-')+
> digit ::= [0..9]
> alpha ::= [a..zA..Z]
>
> So you could have 2.3.1.0-SNAPSHOT, but not 2.3.1-SNAPSHOT,
> if I'm reading this right. (Where OSGi would treat 0-SNAPSHOT
> as a single, unanalyzed token).
>
> I have no problem with the maven convention, and I totally
> agree we should use the same version string wherever possible.
> It's just that for OSGi modules other than Eclipse, we may
> have to do something special after all.
>
> --Thilo
>
> On 5/3/2010 17:30, Marshall Schor wrote:
>
>>
>> On 5/3/2010 10:59 AM, Thilo Goetz wrote:
>>
>>> Marshall,
>>>
>>> 2.3.1-SNAPSHOT is not a valid OSGi version number.
>>>
>> I read on the internet (makes it true :-) ) in the reference link
>> below that
>> "
>>
>> According to OSGi spec 4.1 section 3.5.2 Bundle-SymbolicName has syntax:
>> Bundle-SymbolicName ::= symbolic-name ( ';' parameter ) *
>> and in 1.3.2 we see the following:
>> symbolic-name ::= token('.'token)*
>> token ::= ( alphanum | '_' | '-')+
>>
>> so '-' is a legal character and therefor eclipse should not warn us
>>
>> Is this incorrect? Or is this an OSGi spec back-level compliance issue?
>>
>> -Marshall
>>
>>
>>> Eclipse
>>> may be doing funny stuff to get around this, but it's not
>>> going to work for other OSGi runtimes. Not sure if that
>>> affects Tommaso's work?
>>>
>>> --Thilo
>>>
>>> On 5/3/2010 16:47, Marshall Schor wrote:
>>>
>>>
>>>> For our builds, we have been doing extra stuff to have 2 kinds of versions:
>>>>
>>>> Maven conventions: 2.3.1-SNAPSHOT and
>>>> Eclipse plugin conventions: 2.3.1.SNAPSHOT
>>>>
>>>> Eclipse appears to have been updated to allow the dash: see
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=197503
>>>>
>>>> So I'll presume this works and as part of my maven alignment work,
>>>> remove the special treatment of versions for eclipse & osgi plugins,
>>>> going forward.
>>>>
>>>> -Marshall
>>>>
>>>>
>>>
>>>
>
>