You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Benson Margulies <bi...@gmail.com> on 2011/08/29 14:43:34 UTC

qualifier versus SNAPSHOT in the bundle plugin

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?

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


Re: qualifier versus SNAPSHOT in the bundle plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
On 29 August 2011 17:48, Benson Margulies <bi...@gmail.com> wrote:

> One more question:
>
> I tried using <_snapshot>....</_snapshot> from the bnd doc, as an
> alternative to automate release versus snapshot, but it didn't work.
> Is that version of bnd not in the plugin yet?


nope, that switch was added in bnd 1.44.0 (http://www.aqute.biz/Bnd/Download)
which is not yet available on central


> On Mon, Aug 29, 2011 at 12:43 PM, Benson Margulies
> <bi...@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>
> >
> > On Mon, Aug 29, 2011 at 8:50 AM, Marcel Offermans
> > <ma...@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

Re: qualifier versus SNAPSHOT in the bundle plugin

Posted by Benson Margulies <bi...@gmail.com>.
One more question:

I tried using <_snapshot>....</_snapshot> from the bnd doc, as an
alternative to automate release versus snapshot, but it didn't work.
Is that version of bnd not in the plugin yet?


On Mon, Aug 29, 2011 at 12:43 PM, Benson Margulies
<bi...@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>
>
> On Mon, Aug 29, 2011 at 8:50 AM, Marcel Offermans
> <ma...@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


Re: qualifier versus SNAPSHOT in the bundle plugin

Posted by Benson Margulies <bi...@gmail.com>.
>> 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.
>
> I doubt looking at the bundleplugin source would help, since this is related to stock Maven interpolation which is applied before the bundleplugin executes
>

As a maven committer, I can tell you that I have no idea how the
disparate behavior could arise except if the plugin actually defines
maven props as it goes. How about, however, adding advice about () to
the doc?

> I generally use round brackets for bnd macros and properties to make sure that Maven isn't going to touch them
>
>>
>>>
>>> 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
>>>> <ma...@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
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: qualifier versus SNAPSHOT in the bundle plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
On 30 Aug 2011, at 13:38, Benson Margulies wrote:

> On Tue, Aug 30, 2011 at 6:32 AM, Stuart McCulloch <mc...@gmail.com> wrote:
>> On 29 August 2011 17:43, Benson Margulies <bi...@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.

I doubt looking at the bundleplugin source would help, since this is related to stock Maven interpolation which is applied before the bundleplugin executes

I generally use round brackets for bnd macros and properties to make sure that Maven isn't going to touch them

> 
>> 
>> 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
>>> <ma...@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
> 


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


Re: qualifier versus SNAPSHOT in the bundle plugin

Posted by Benson Margulies <bi...@gmail.com>.
On Tue, Aug 30, 2011 at 6:32 AM, Stuart McCulloch <mc...@gmail.com> wrote:
> On 29 August 2011 17:43, Benson Margulies <bi...@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
>> <ma...@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


Re: qualifier versus SNAPSHOT in the bundle plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
On 29 August 2011 17:43, Benson Margulies <bi...@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

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
> <ma...@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

Re: qualifier versus SNAPSHOT in the bundle plugin

Posted by Benson Margulies <bi...@gmail.com>.
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>

On Mon, Aug 29, 2011 at 8:50 AM, Marcel Offermans
<ma...@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


Re: qualifier versus SNAPSHOT in the bundle plugin

Posted by Marcel Offermans <ma...@luminis.nl>.
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