You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2013/05/24 06:43:35 UTC

Project.version too contextual

Hi guys,

Project.version seems evaluated by pom and not from the pom it is defined
(at least in a multi modules project without a single version).

So basically you can get a version very different from the expected one.

If this is the expected behavior, could it be another variable to force the
origin version?

Re: Project.version too contextual

Posted by Fred Cooke <fr...@gmail.com>.
Thank you Robert! I *knew* it was something core :-) Expand this syntax
*everywhere* and allow people more control over what happens? Seems like a
solid solution at face value, but could have gotchas, of course...

On Fri, May 24, 2013 at 7:46 PM, Robert Scholte <rf...@apache.org>wrote:

> http://maven.apache.org/maven-**release/maven-release-plugin/**
> prepare-mojo.html#**tagNameFormat<http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#tagNameFormat>uses @{} so it is not resolved immediately, but only when the plugin wants
> to.
>
> maven-invoker-plugin only filters @value@ when cloning projects to the
> target, so the ${value} are only resolved during execution.
>
> Robert
>
>
> Op Fri, 24 May 2013 18:59:20 +0200 schreef Fred Cooke <
> fred.cooke@gmail.com>:
>
>
>  Definitely not that, I've not used it, however something else does have a
>> @{} syntax, something common. I'm sorry that I can't recall right  now
>> what
>> it was.
>>
>> On Fri, May 24, 2013 at 6:54 PM, Hervé BOUTEMY <herve.boutemy@free.fr
>> >wrote:
>>
>>  maven-invoker-plugin filtering?
>>>
>>> http://maven.apache.org/**plugins/maven-invoker-plugin/**
>>> examples/filtering.html<http://maven.apache.org/plugins/maven-invoker-plugin/examples/filtering.html>
>>>
>>> Le vendredi 24 mai 2013 13:01:08 Fred Cooke a écrit :
>>> > > AFAIK, there is no feature to evaluate before inheritance: this would
>>> > > require
>>> >
>>> > a new notation than ${xxx}, which could be interpreted before
>>> inheritance
>>> >
>>> >
>>> > If I recall correctly, and I still need to apologise to you for my last
>>> > mistake, there is something like @{} in use in one of the (core?)
>>> plugins?
>>> > I seem to remember trying to use it elsewhere and being disappointed
>>> :-)
>>> >
>>> > Regards,
>>> >
>>> > Fred.
>>> >
>>> > [1] http://maven.apache.org/ref/3.**1.0-alpha-1/maven-model-**builder/<http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/>
>>> >
>>> > > Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
>>> > > > Hi guys,
>>> > > >
>>> > > > Project.version seems evaluated by pom and not from the pom it is
>>> > > > defined
>>> > > > (at least in a multi modules project without a single version).
>>> > > >
>>> > > > So basically you can get a version very different from the expected
>>> one.
>>> > > >
>>> > > > If this is the expected behavior, could it be another variable to
>>> force
>>> > >
>>> > > the
>>> > >
>>> > > > origin version?
>>> > >
>>> > > ------------------------------**------------------------------**
>>> ---------
>>> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.**org<de...@maven.apache.org>
>>> > > For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.**org<de...@maven.apache.org>
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.**org<de...@maven.apache.org>
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Project.version too contextual

Posted by Robert Scholte <rf...@apache.org>.
http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#tagNameFormat  
uses @{} so it is not resolved immediately, but only when the plugin wants  
to.

maven-invoker-plugin only filters @value@ when cloning projects to the  
target, so the ${value} are only resolved during execution.

Robert


Op Fri, 24 May 2013 18:59:20 +0200 schreef Fred Cooke  
<fr...@gmail.com>:

> Definitely not that, I've not used it, however something else does have a
> @{} syntax, something common. I'm sorry that I can't recall right  now  
> what
> it was.
>
> On Fri, May 24, 2013 at 6:54 PM, Hervé BOUTEMY  
> <he...@free.fr>wrote:
>
>> maven-invoker-plugin filtering?
>>
>> http://maven.apache.org/plugins/maven-invoker-plugin/examples/filtering.html
>>
>> Le vendredi 24 mai 2013 13:01:08 Fred Cooke a écrit :
>> > > AFAIK, there is no feature to evaluate before inheritance: this  
>> would
>> > > require
>> >
>> > a new notation than ${xxx}, which could be interpreted before  
>> inheritance
>> >
>> >
>> > If I recall correctly, and I still need to apologise to you for my  
>> last
>> > mistake, there is something like @{} in use in one of the (core?)
>> plugins?
>> > I seem to remember trying to use it elsewhere and being disappointed  
>> :-)
>> >
>> > Regards,
>> >
>> > Fred.
>> >
>> > [1] http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/
>> >
>> > > Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
>> > > > Hi guys,
>> > > >
>> > > > Project.version seems evaluated by pom and not from the pom it is
>> > > > defined
>> > > > (at least in a multi modules project without a single version).
>> > > >
>> > > > So basically you can get a version very different from the  
>> expected
>> one.
>> > > >
>> > > > If this is the expected behavior, could it be another variable to
>> force
>> > >
>> > > the
>> > >
>> > > > origin version?
>> > >
>> > >  
>> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> > > For additional commands, e-mail: dev-help@maven.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Project.version too contextual

Posted by Fred Cooke <fr...@gmail.com>.
Definitely not that, I've not used it, however something else does have a
@{} syntax, something common. I'm sorry that I can't recall right  now what
it was.

On Fri, May 24, 2013 at 6:54 PM, Hervé BOUTEMY <he...@free.fr>wrote:

> maven-invoker-plugin filtering?
>
> http://maven.apache.org/plugins/maven-invoker-plugin/examples/filtering.html
>
> Le vendredi 24 mai 2013 13:01:08 Fred Cooke a écrit :
> > > AFAIK, there is no feature to evaluate before inheritance: this would
> > > require
> >
> > a new notation than ${xxx}, which could be interpreted before inheritance
> >
> >
> > If I recall correctly, and I still need to apologise to you for my last
> > mistake, there is something like @{} in use in one of the (core?)
> plugins?
> > I seem to remember trying to use it elsewhere and being disappointed :-)
> >
> > Regards,
> >
> > Fred.
> >
> > [1] http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/
> >
> > > Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
> > > > Hi guys,
> > > >
> > > > Project.version seems evaluated by pom and not from the pom it is
> > > > defined
> > > > (at least in a multi modules project without a single version).
> > > >
> > > > So basically you can get a version very different from the expected
> one.
> > > >
> > > > If this is the expected behavior, could it be another variable to
> force
> > >
> > > the
> > >
> > > > origin version?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Project.version too contextual

Posted by Hervé BOUTEMY <he...@free.fr>.
maven-invoker-plugin filtering?
http://maven.apache.org/plugins/maven-invoker-plugin/examples/filtering.html

Le vendredi 24 mai 2013 13:01:08 Fred Cooke a écrit :
> > AFAIK, there is no feature to evaluate before inheritance: this would
> > require
> 
> a new notation than ${xxx}, which could be interpreted before inheritance
> 
> 
> If I recall correctly, and I still need to apologise to you for my last
> mistake, there is something like @{} in use in one of the (core?) plugins?
> I seem to remember trying to use it elsewhere and being disappointed :-)
> 
> Regards,
> 
> Fred.
> 
> [1] http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/
> 
> > Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
> > > Hi guys,
> > > 
> > > Project.version seems evaluated by pom and not from the pom it is
> > > defined
> > > (at least in a multi modules project without a single version).
> > > 
> > > So basically you can get a version very different from the expected one.
> > > 
> > > If this is the expected behavior, could it be another variable to force
> > 
> > the
> > 
> > > origin version?
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Project.version too contextual

Posted by Fred Cooke <fr...@gmail.com>.
>
> AFAIK, there is no feature to evaluate before inheritance: this would
> require
>
a new notation than ${xxx}, which could be interpreted before inheritance
>

If I recall correctly, and I still need to apologise to you for my last
mistake, there is something like @{} in use in one of the (core?) plugins?
I seem to remember trying to use it elsewhere and being disappointed :-)

Regards,

Fred.

[1] http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/
>
> Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
> > Hi guys,
> >
> > Project.version seems evaluated by pom and not from the pom it is defined
> > (at least in a multi modules project without a single version).
> >
> > So basically you can get a version very different from the expected one.
> >
> > If this is the expected behavior, could it be another variable to force
> the
> > origin version?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Project.version too contextual

Posted by Romain Manni-Bucau <rm...@gmail.com>.
that's not possible, we use it in too much place and our project is not flat

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/5/24 Brett Porter <br...@porterclan.net>

> You're project will need to be aware of its own structure, but you can use
> things like this: ${project.parent.version}
>
> - Brett
>
> On 23/05/2013, at 11:20 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Yes, that's what i expected but ATM in TomEE we have
> > <openejb.version>hardcoded version</> and for half of the project it
> > matches the project.version (but only half :().
> >
> > That's not blocking at all but if maven could get this kind of feature
> > (maybe #{project.version}) it would be really great
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
> >
> >
> >
> > 2013/5/24 Hervé BOUTEMY <he...@free.fr>
> >
> >> yes, it is the expected behaviour
> >> see [1] for complete documentation of the model building algorithm:
> >> project.version is evaluated during "model interpolation", which happens
> >> after
> >> inheritance
> >>
> >> AFAIK, there is no feature to evaluate before inheritance: this would
> >> require
> >> a new notation than ${xxx}, which could be interpreted before
> inheritance
> >> But, taken apart the fact that this would require good explanations to
> >> make it
> >> understanble by end-users, this would be a new feature that would make
> pom
> >> not
> >> really understandable by actual Maven 3 versions, so there is a
> >> compatibility
> >> issue to take care
> >>
> >> Regards,
> >>
> >> Hervé
> >>
> >>
> >> [1] http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/
> >>
> >> Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
> >>> Hi guys,
> >>>
> >>> Project.version seems evaluated by pom and not from the pom it is
> defined
> >>> (at least in a multi modules project without a single version).
> >>>
> >>> So basically you can get a version very different from the expected
> one.
> >>>
> >>> If this is the expected behavior, could it be another variable to force
> >> the
> >>> origin version?
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
>
> --
> Brett Porter
> brett@apache.org
> http://brettporter.wordpress.com/
> http://au.linkedin.com/in/brettporter
> http://twitter.com/brettporter
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Project.version too contextual

Posted by Brett Porter <br...@porterclan.net>.
You're project will need to be aware of its own structure, but you can use things like this: ${project.parent.version}

- Brett

On 23/05/2013, at 11:20 PM, Romain Manni-Bucau <rm...@gmail.com> wrote:

> Yes, that's what i expected but ATM in TomEE we have
> <openejb.version>hardcoded version</> and for half of the project it
> matches the project.version (but only half :().
> 
> That's not blocking at all but if maven could get this kind of feature
> (maybe #{project.version}) it would be really great
> 
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
> 
> 
> 
> 2013/5/24 Hervé BOUTEMY <he...@free.fr>
> 
>> yes, it is the expected behaviour
>> see [1] for complete documentation of the model building algorithm:
>> project.version is evaluated during "model interpolation", which happens
>> after
>> inheritance
>> 
>> AFAIK, there is no feature to evaluate before inheritance: this would
>> require
>> a new notation than ${xxx}, which could be interpreted before inheritance
>> But, taken apart the fact that this would require good explanations to
>> make it
>> understanble by end-users, this would be a new feature that would make pom
>> not
>> really understandable by actual Maven 3 versions, so there is a
>> compatibility
>> issue to take care
>> 
>> Regards,
>> 
>> Hervé
>> 
>> 
>> [1] http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/
>> 
>> Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
>>> Hi guys,
>>> 
>>> Project.version seems evaluated by pom and not from the pom it is defined
>>> (at least in a multi modules project without a single version).
>>> 
>>> So basically you can get a version very different from the expected one.
>>> 
>>> If this is the expected behavior, could it be another variable to force
>> the
>>> origin version?
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter
http://twitter.com/brettporter






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Project.version too contextual

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yes, that's what i expected but ATM in TomEE we have
<openejb.version>hardcoded version</> and for half of the project it
matches the project.version (but only half :().

That's not blocking at all but if maven could get this kind of feature
(maybe #{project.version}) it would be really great

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/5/24 Hervé BOUTEMY <he...@free.fr>

> yes, it is the expected behaviour
> see [1] for complete documentation of the model building algorithm:
> project.version is evaluated during "model interpolation", which happens
> after
> inheritance
>
> AFAIK, there is no feature to evaluate before inheritance: this would
> require
> a new notation than ${xxx}, which could be interpreted before inheritance
> But, taken apart the fact that this would require good explanations to
> make it
> understanble by end-users, this would be a new feature that would make pom
> not
> really understandable by actual Maven 3 versions, so there is a
> compatibility
> issue to take care
>
> Regards,
>
> Hervé
>
>
> [1] http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/
>
> Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
> > Hi guys,
> >
> > Project.version seems evaluated by pom and not from the pom it is defined
> > (at least in a multi modules project without a single version).
> >
> > So basically you can get a version very different from the expected one.
> >
> > If this is the expected behavior, could it be another variable to force
> the
> > origin version?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Project.version too contextual

Posted by Hervé BOUTEMY <he...@free.fr>.
yes, it is the expected behaviour
see [1] for complete documentation of the model building algorithm: 
project.version is evaluated during "model interpolation", which happens after 
inheritance

AFAIK, there is no feature to evaluate before inheritance: this would require 
a new notation than ${xxx}, which could be interpreted before inheritance
But, taken apart the fact that this would require good explanations to make it 
understanble by end-users, this would be a new feature that would make pom not 
really understandable by actual Maven 3 versions, so there is a compatibility 
issue to take care

Regards,

Hervé


[1] http://maven.apache.org/ref/3.1.0-alpha-1/maven-model-builder/

Le vendredi 24 mai 2013 06:43:35 Romain Manni-Bucau a écrit :
> Hi guys,
> 
> Project.version seems evaluated by pom and not from the pom it is defined
> (at least in a multi modules project without a single version).
> 
> So basically you can get a version very different from the expected one.
> 
> If this is the expected behavior, could it be another variable to force the
> origin version?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org