You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mirko Friedenhagen <mf...@gmail.com> on 2012/04/28 22:01:04 UTC

Lifecycle phase in which the url for distributionManagement/snapshotRepository is calculated

Hello,

I developed a plugin which creates an additional property during the
validate phase and want to use it as part of the
snapshotRepository/url. However the property is not resolved but the
name of the property is inserted. I may access the calculated property
and insert it into Could anybody tell me in which phase the urls in
distributionManagement are resolved?

Regards Mirko

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


Re: Lifecycle phase in which the url for distributionManagement/snapshotRepository is calculated

Posted by Olivier Lamy <ol...@apache.org>.
Yep but means having your jar locally in your m3 installation.

--
Olivier
Le 30 avr. 2012 21:03, "Mirko Friedenhagen" <mf...@gmail.com> a
écrit :

> Hello Olivier,
>
> I assume I have to create the properties in afterSessionStart as
> afterProjectsRead will be to late again?
>
> Regards Mirko
>
> On Sun, Apr 29, 2012 at 21:22, Olivier Lamy <ol...@apache.org> wrote:
> > Yup you can add properties to project.getProperties()
> > But in your case you want to change distributionManagement urls using
> > properties interpolation mechanism ? but it's too late using a plugin
> > as model has been build.
> >
> > An option you have maybe it's to use maven3 lifecycle extension
> > mechanism:
> http://maven.apache.org/examples/maven-3-lifecycle-extensions.html
> >
> > 2012/4/29 Mirko Friedenhagen <mf...@gmail.com>:
> >> Hm, so this seems to be true only for some elements of the pom but not
> >> plugin configurations. The
> >> http://mojo.codehaus.org/buildnumber-maven-plugin/ actually adds
> >> buildNumber and uses it in e.g. the maven-jar-plugin to add a field
> >> Implementation-Build.
> >>
> >> Regards Mirko
> >>
> >>
> >> On Sun, Apr 29, 2012 at 11:09, Hervé BOUTEMY <he...@free.fr>
> wrote:
> >>> yes, property evaluations is done in the "model interpolation" step of
> the
> >>> Maven model build: see [1] for a global view
> >>>
> >>> no, no plugin can add any property at any phase, sorry
> >>>
> >>> Regards,
> >>>
> >>> Hervé
> >>>
> >>> [1] http://maven.apache.org/ref/3.0.4/maven-model-builder/
> >>>
> >>> Le dimanche 29 avril 2012 08:36:10 Anders Hammar a écrit :
> >>>> I think it is resolved even before the build lifecycle starts.
> >>>>
> >>>> /Anders
> >>>>
> >>>> On Sat, Apr 28, 2012 at 22:01, Mirko Friedenhagen
> >>>>
> >>>> <mf...@gmail.com> wrote:
> >>>> > Hello,
> >>>> >
> >>>> > I developed a plugin which creates an additional property during the
> >>>> > validate phase and want to use it as part of the
> >>>> > snapshotRepository/url. However the property is not resolved but the
> >>>> > name of the property is inserted. I may access the calculated
> property
> >>>> > and insert it into Could anybody tell me in which phase the urls in
> >>>> > distributionManagement are resolved?
> >>>> >
> >>>> > Regards Mirko
> >>>> >
> >>>> >
> ---------------------------------------------------------------------
> >>>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> > For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >
> >
> >
> > --
> > Olivier Lamy
> > Talend: http://coders.talend.com
> > http://twitter.com/olamy | http://linkedin.com/in/olamy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Lifecycle phase in which the url for distributionManagement/snapshotRepository is calculated

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Hello Olivier,

I assume I have to create the properties in afterSessionStart as
afterProjectsRead will be to late again?

Regards Mirko

On Sun, Apr 29, 2012 at 21:22, Olivier Lamy <ol...@apache.org> wrote:
> Yup you can add properties to project.getProperties()
> But in your case you want to change distributionManagement urls using
> properties interpolation mechanism ? but it's too late using a plugin
> as model has been build.
>
> An option you have maybe it's to use maven3 lifecycle extension
> mechanism: http://maven.apache.org/examples/maven-3-lifecycle-extensions.html
>
> 2012/4/29 Mirko Friedenhagen <mf...@gmail.com>:
>> Hm, so this seems to be true only for some elements of the pom but not
>> plugin configurations. The
>> http://mojo.codehaus.org/buildnumber-maven-plugin/ actually adds
>> buildNumber and uses it in e.g. the maven-jar-plugin to add a field
>> Implementation-Build.
>>
>> Regards Mirko
>>
>>
>> On Sun, Apr 29, 2012 at 11:09, Hervé BOUTEMY <he...@free.fr> wrote:
>>> yes, property evaluations is done in the "model interpolation" step of the
>>> Maven model build: see [1] for a global view
>>>
>>> no, no plugin can add any property at any phase, sorry
>>>
>>> Regards,
>>>
>>> Hervé
>>>
>>> [1] http://maven.apache.org/ref/3.0.4/maven-model-builder/
>>>
>>> Le dimanche 29 avril 2012 08:36:10 Anders Hammar a écrit :
>>>> I think it is resolved even before the build lifecycle starts.
>>>>
>>>> /Anders
>>>>
>>>> On Sat, Apr 28, 2012 at 22:01, Mirko Friedenhagen
>>>>
>>>> <mf...@gmail.com> wrote:
>>>> > Hello,
>>>> >
>>>> > I developed a plugin which creates an additional property during the
>>>> > validate phase and want to use it as part of the
>>>> > snapshotRepository/url. However the property is not resolved but the
>>>> > name of the property is inserted. I may access the calculated property
>>>> > and insert it into Could anybody tell me in which phase the urls in
>>>> > distributionManagement are resolved?
>>>> >
>>>> > Regards Mirko
>>>> >
>>>> > ---------------------------------------------------------------------
>>>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> > For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
>
>
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: Lifecycle phase in which the url for distributionManagement/snapshotRepository is calculated

Posted by Olivier Lamy <ol...@apache.org>.
Yup you can add properties to project.getProperties()
But in your case you want to change distributionManagement urls using
properties interpolation mechanism ? but it's too late using a plugin
as model has been build.

An option you have maybe it's to use maven3 lifecycle extension
mechanism: http://maven.apache.org/examples/maven-3-lifecycle-extensions.html

2012/4/29 Mirko Friedenhagen <mf...@gmail.com>:
> Hm, so this seems to be true only for some elements of the pom but not
> plugin configurations. The
> http://mojo.codehaus.org/buildnumber-maven-plugin/ actually adds
> buildNumber and uses it in e.g. the maven-jar-plugin to add a field
> Implementation-Build.
>
> Regards Mirko
>
>
> On Sun, Apr 29, 2012 at 11:09, Hervé BOUTEMY <he...@free.fr> wrote:
>> yes, property evaluations is done in the "model interpolation" step of the
>> Maven model build: see [1] for a global view
>>
>> no, no plugin can add any property at any phase, sorry
>>
>> Regards,
>>
>> Hervé
>>
>> [1] http://maven.apache.org/ref/3.0.4/maven-model-builder/
>>
>> Le dimanche 29 avril 2012 08:36:10 Anders Hammar a écrit :
>>> I think it is resolved even before the build lifecycle starts.
>>>
>>> /Anders
>>>
>>> On Sat, Apr 28, 2012 at 22:01, Mirko Friedenhagen
>>>
>>> <mf...@gmail.com> wrote:
>>> > Hello,
>>> >
>>> > I developed a plugin which creates an additional property during the
>>> > validate phase and want to use it as part of the
>>> > snapshotRepository/url. However the property is not resolved but the
>>> > name of the property is inserted. I may access the calculated property
>>> > and insert it into Could anybody tell me in which phase the urls in
>>> > distributionManagement are resolved?
>>> >
>>> > Regards Mirko
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> > For additional commands, e-mail: users-help@maven.apache.org
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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


Re: Lifecycle phase in which the url for distributionManagement/snapshotRepository is calculated

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Hm, so this seems to be true only for some elements of the pom but not
plugin configurations. The
http://mojo.codehaus.org/buildnumber-maven-plugin/ actually adds
buildNumber and uses it in e.g. the maven-jar-plugin to add a field
Implementation-Build.

Regards Mirko


On Sun, Apr 29, 2012 at 11:09, Hervé BOUTEMY <he...@free.fr> wrote:
> yes, property evaluations is done in the "model interpolation" step of the
> Maven model build: see [1] for a global view
>
> no, no plugin can add any property at any phase, sorry
>
> Regards,
>
> Hervé
>
> [1] http://maven.apache.org/ref/3.0.4/maven-model-builder/
>
> Le dimanche 29 avril 2012 08:36:10 Anders Hammar a écrit :
>> I think it is resolved even before the build lifecycle starts.
>>
>> /Anders
>>
>> On Sat, Apr 28, 2012 at 22:01, Mirko Friedenhagen
>>
>> <mf...@gmail.com> wrote:
>> > Hello,
>> >
>> > I developed a plugin which creates an additional property during the
>> > validate phase and want to use it as part of the
>> > snapshotRepository/url. However the property is not resolved but the
>> > name of the property is inserted. I may access the calculated property
>> > and insert it into Could anybody tell me in which phase the urls in
>> > distributionManagement are resolved?
>> >
>> > Regards Mirko
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: Lifecycle phase in which the url for distributionManagement/snapshotRepository is calculated

Posted by Hervé BOUTEMY <he...@free.fr>.
yes, property evaluations is done in the "model interpolation" step of the 
Maven model build: see [1] for a global view

no, no plugin can add any property at any phase, sorry

Regards,

Hervé

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

Le dimanche 29 avril 2012 08:36:10 Anders Hammar a écrit :
> I think it is resolved even before the build lifecycle starts.
> 
> /Anders
> 
> On Sat, Apr 28, 2012 at 22:01, Mirko Friedenhagen
> 
> <mf...@gmail.com> wrote:
> > Hello,
> > 
> > I developed a plugin which creates an additional property during the
> > validate phase and want to use it as part of the
> > snapshotRepository/url. However the property is not resolved but the
> > name of the property is inserted. I may access the calculated property
> > and insert it into Could anybody tell me in which phase the urls in
> > distributionManagement are resolved?
> > 
> > Regards Mirko
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

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


Re: Lifecycle phase in which the url for distributionManagement/snapshotRepository is calculated

Posted by Anders Hammar <an...@hammar.net>.
I think it is resolved even before the build lifecycle starts.

/Anders

On Sat, Apr 28, 2012 at 22:01, Mirko Friedenhagen
<mf...@gmail.com> wrote:
> Hello,
>
> I developed a plugin which creates an additional property during the
> validate phase and want to use it as part of the
> snapshotRepository/url. However the property is not resolved but the
> name of the property is inserted. I may access the calculated property
> and insert it into Could anybody tell me in which phase the urls in
> distributionManagement are resolved?
>
> Regards Mirko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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