felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <bimargul...@gmail.com>
Subject Re: qualifier versus SNAPSHOT in the bundle plugin
Date Tue, 30 Aug 2011 12:38:19 GMT
On Tue, Aug 30, 2011 at 6:32 AM, Stuart McCulloch <mcculls@gmail.com> wrote:
> On 29 August 2011 17:43, Benson Margulies <bimargulies@gmail.com> wrote:
>
>> I got the following by attempting to map this into the maven plugin.
>>
>> 1.0.0.orgapachemavenmodelBuild43ce663c
>>
>> Is this right? It's not quite what I expected.
>>
>> I used:
>>
>>   <build>\${tstamp}</build>
>>   <!-- hmm, has to be updated for releases -->
>>   <Bundle-Version>1.0.0.\${build}</Bundle-Version>
>
>
> looks like maven is interpolating the ${build} variable as ${project.build}
> using the Maven model

Here's what worked:

		        <stamp>$${tstamp}</stamp>
			<!-- hmm, has to be updated for releases -->
 		        <Bundle-Version>1.0.0.${stamp}</Bundle-Version>

Notice that I had to escape the first, and not the second. I haven't
look at the java source of the plugin to see if I can explain this.


>
> bnd supports use of other brackets, so you could use round brackets instead
> to stop Maven from doing its interpolation:
>
>   <Bundle-Version>1.0.0.$(tstamp)</Bundle-Version>
>
> or if you still want to use an intermediate variable:
>
>    <build>$(tstamp)</build>
>    <Bundle-Version>1.0.0.$(build)</Bundle-Version>
>
> bnd also supports macros (http://www.aqute.biz/Bnd/Macros) so you can also
> do things like:
>
>
>  <Bundle-Version>$(replace;${project.version};-SNAPSHOT;.$(tstamp))</Bundle-Version>
>
> to avoid the issue with OSGi versions that 1.0.0 is earlier than
> 1.0.0.20110830 you could use:
>
>
> <qualifier>$(if;$(filter;$(project.version);.*-SNAPSHOT);v$(tstamp);GA)</qualifier>
>
> <Bundle-Version>$(replace;$(project.version);^(.*?)(-SNAPSHOT)?$;$1.$(qualifier))</Bundle-Version>
>
> which will use "v$(tstamp)" as the qualifier for snapshot versions, and "GA"
> for the final release
>
> but we could definitely make this easier by providing a simple switch in the
> plugin - so if anyone has time to whip up a path, feel free...
>
> On Mon, Aug 29, 2011 at 8:50 AM, Marcel Offermans
>> <marcel.offermans@luminis.nl> wrote:
>> > On 29 Aug 2011, at 14:43 , Benson Margulies wrote:
>> >
>> >> The eclipse ecosystem seems to like to use 'qualifier' as a qualifier
>> >> to spit out a unique number. Can I do that in the plugin by explicitly
>> >> specifying 'qualifier' in the instructions?
>> >
>> > The Bnd instructions for this are:
>> >
>> > build = ${tstamp}
>> > Bundle-Version: 1.0.0.${build}
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> > For additional commands, e-mail: users-help@felix.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
>
> --
> Cheers, Stuart
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message