Take a look at the m2release plugin – you can dynamically (and optionally) change the default goals that get passed to maven in a plugin.
/James
From: jenkinsci-dev@googlegroups.com [mailto:jenkinsci-dev@googlegroups.com] On Behalf Of Dimitri CHARLES
Sent: 14 November 2012 09:11
To: jenkinsci-dev@googlegroups.com
Subject: Calling a maven instance from a plugin
Hi, I am actually writing a plugin where I want to pass some customs parameters, goals
to a maven instance. For instance, some profiles, some properties contained in a POM (-Dproperty=value).
and I instantiate this property with my custom goals. In my perform method, I call maven.perform().
For the AbstractMavenBuilder, I discovered it yesterday and I was thinking to extend this class.
Is this a better way to do that? Can you show an example how to call a maven instance from a plugin?
Thanks for your suggestion
________________________________
*************************************************************************** ***********
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
*************************************************************************** ***********
> and I instantiate this property with my custom goals. In my perform > method, I call maven.perform().
> For the AbstractMavenBuilder, I discovered it yesterday and I was > thinking to extend this class.
> Is this a better way to do that? Can you show an example how to call a > maven instance from a plugin?
> Thanks for your suggestion
> ------------------------------
> *************************************************************************** ***********
> This message is confidential and intended only for the addressee. If you > have received this message in error, please immediately notify the > postm...@nds.com <javascript:> and delete it from your system as well as > any copies. The content of e-mails as well as traffic data may be monitored > by NDS for employment and security purposes. To protect the environment > please do not print this e-mail unless necessary.
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 > 4EX, United Kingdom. A company registered in England and Wales. Registered > no. 3080780. VAT no. GB 603 8808 40-00
Don’t use it – just look at the code which will give you an example of changing the goals.
/James
From: jenkinsci-dev@googlegroups.com [mailto:jenkinsci-dev@googlegroups.com] On Behalf Of Dimitri CHARLES
Sent: 14 November 2012 11:57
To: jenkinsci-dev@googlegroups.com
Subject: Re: Calling a maven instance from a plugin
Hi James,
Thanks for your answer.
How can I use this plugin. I see that it is used to perform Maven release. Can you give me an example how can I use it?
Thanks
Le mercredi 14 novembre 2012 12:29:14 UTC+1, teilo a écrit :
Take a look at the m2release plugin – you can dynamically (and optionally) change the default goals that get passed to maven in a plugin.
/James
From: jenkin...@googlegroups.com [mailto:jenkin...@googlegroups.com] On Behalf Of Dimitri CHARLES
Sent: 14 November 2012 09:11
To: jenkin...@googlegroups.com
Subject: Calling a maven instance from a plugin
Hi, I am actually writing a plugin where I want to pass some customs parameters, goals
to a maven instance. For instance, some profiles, some properties contained in a POM (-Dproperty=value).
and I instantiate this property with my custom goals. In my perform method, I call maven.perform().
For the AbstractMavenBuilder, I discovered it yesterday and I was thinking to extend this class.
Is this a better way to do that? Can you show an example how to call a maven instance from a plugin?
Thanks for your suggestion
________________________________
*************************************************************************** ***********
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postm...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
*************************************************************************** ***********
________________________________
*************************************************************************** ***********
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
*************************************************************************** ***********
> Don’t use it – just look at the code which will give you an example of > changing the goals.
> /James
> *From:* jenkin...@googlegroups.com <javascript:> [mailto:
> jenkin...@googlegroups.com <javascript:>] *On Behalf Of *Dimitri CHARLES
> *Sent:* 14 November 2012 11:57
> *To:* jenkin...@googlegroups.com <javascript:>
> *Subject:* Re: Calling a maven instance from a plugin
> Hi James,
> Thanks for your answer.
> How can I use this plugin. I see that it is used to perform Maven release. > Can you give me an example how can I use it?
> Thanks
> Le mercredi 14 novembre 2012 12:29:14 UTC+1, teilo a écrit :
> Take a look at the m2release plugin – you can dynamically (and optionally) > change the default goals that get passed to maven in a plugin.
> /James
> *From:* jenkin...@googlegroups.com [mailto:jenkin...@googlegroups.com] *On > Behalf Of *Dimitri CHARLES
> *Sent:* 14 November 2012 09:11
> *To:* jenkin...@googlegroups.com
> *Subject:* Calling a maven instance from a plugin
> Hi, I am actually writing a plugin where I want to pass some customs > parameters, goals
> to a maven instance. For instance, some profiles, some properties > contained in a POM (-Dproperty=value).
> and I instantiate this property with my custom goals. In my perform > method, I call maven.perform().
> For the AbstractMavenBuilder, I discovered it yesterday and I was > thinking to extend this class.
> Is this a better way to do that? Can you show an example how to call a > maven instance from a plugin?
> Thanks for your suggestion
> ------------------------------
> *************************************************************************** ***********
> This message is confidential and intended only for the addressee. If you > have received this message in error, please immediately notify the > postm...@nds.com and delete it from your system as well as any copies. > The content of e-mails as well as traffic data may be monitored by NDS for > employment and security purposes. To protect the environment please do not > print this e-mail unless necessary.
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 > 4EX, United Kingdom. A company registered in England and Wales. Registered > no. 3080780. VAT no. GB 603 8808 40-00
> *************************************************************************** ***********
> This message is confidential and intended only for the addressee. If you > have received this message in error, please immediately notify the > postm...@nds.com <javascript:> and delete it from your system as well as > any copies. The content of e-mails as well as traffic data may be monitored > by NDS for employment and security purposes. To protect the environment > please do not print this e-mail unless necessary.
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 > 4EX, United Kingdom. A company registered in England and Wales. Registered > no. 3080780. VAT no. GB 603 8808 40-00
It uses the getGoalsAndOptions rather than the intercept.
Intercept is more for adding extra options, getGotalsAndOptions is used to change the default goals that run (the ones that are normally entered in the UI).
From: jenkinsci-dev@googlegroups.com [mailto:jenkinsci-dev@googlegroups.com] On Behalf Of Dimitri CHARLES
Sent: 14 November 2012 14:37
To: jenkinsci-dev@googlegroups.com
Subject: Re: Calling a maven instance from a plugin
Hi James,
Thanks for your answer.
I watched and it seems that I have to implement MavenArgumentInterceptorAction.
But in the class M2ReleaseArgumentInterceptorAction, why dont implement the intercept method?
Le mercredi 14 novembre 2012 13:04:45 UTC+1, teilo a écrit :
Hi Dimitri,
Don’t use it – just look at the code which will give you an example of changing the goals.
/James
From: jenkin...@googlegroups.com [mailto:jenkin...@googlegroups.com] On Behalf Of Dimitri CHARLES
Sent: 14 November 2012 11:57
To: jenkin...@googlegroups.com
Subject: Re: Calling a maven instance from a plugin
Hi James,
Thanks for your answer.
How can I use this plugin. I see that it is used to perform Maven release. Can you give me an example how can I use it?
Thanks
Le mercredi 14 novembre 2012 12:29:14 UTC+1, teilo a écrit :
Take a look at the m2release plugin – you can dynamically (and optionally) change the default goals that get passed to maven in a plugin.
/James
From: jenkin...@googlegroups.com<mailto:jenkin...@googlegroups.com> [mailto:jenkin...@googlegroups.com] On Behalf Of Dimitri CHARLES
Sent: 14 November 2012 09:11
To: jenkin...@googlegroups.com<mailto:jenkin...@googlegroups.com>
Subject: Calling a maven instance from a plugin
Hi, I am actually writing a plugin where I want to pass some customs parameters, goals
to a maven instance. For instance, some profiles, some properties contained in a POM (-Dproperty=value).
and I instantiate this property with my custom goals. In my perform method, I call maven.perform().
For the AbstractMavenBuilder, I discovered it yesterday and I was thinking to extend this class.
Is this a better way to do that? Can you show an example how to call a maven instance from a plugin?
Thanks for your suggestion
________________________________
*************************************************************************** ***********
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postm...@nds.com<mailto:postm...@nds.com> and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
*************************************************************************** ***********
________________________________
*************************************************************************** ***********
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postm...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
*************************************************************************** ***********
________________________________
*************************************************************************** ***********
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
*************************************************************************** ***********
> It uses the getGoalsAndOptions rather than the intercept.
> Intercept is more for adding extra options, getGotalsAndOptions is used to > change the default goals that run (the ones that are normally entered in > the UI).
> *From:* jenkin...@googlegroups.com <javascript:> [mailto:
> jenkin...@googlegroups.com <javascript:>] *On Behalf Of *Dimitri CHARLES
> *Sent:* 14 November 2012 14:37
> *To:* jenkin...@googlegroups.com <javascript:>
> *Subject:* Re: Calling a maven instance from a plugin
> Hi James,
> Thanks for your answer.
> I watched and it seems that I have to implement > MavenArgumentInterceptorAction.
> But in the class M2ReleaseArgumentInterceptorAction, why dont implement > the intercept method?
> Le mercredi 14 novembre 2012 13:04:45 UTC+1, teilo a écrit :
> Hi Dimitri,
> Don’t use it – just look at the code which will give you an example of > changing the goals.
> /James
> *From:* jenkin...@googlegroups.com [mailto:jenkin...@googlegroups.com] *On > Behalf Of *Dimitri CHARLES
> *Sent:* 14 November 2012 11:57
> *To:* jenkin...@googlegroups.com
> *Subject:* Re: Calling a maven instance from a plugin
> Hi James,
> Thanks for your answer.
> How can I use this plugin. I see that it is used to perform Maven release. > Can you give me an example how can I use it?
> Thanks
> Le mercredi 14 novembre 2012 12:29:14 UTC+1, teilo a écrit :
> Take a look at the m2release plugin – you can dynamically (and optionally) > change the default goals that get passed to maven in a plugin.
> /James
> *From:* jenkin...@googlegroups.com [mailto:jenkin...@googlegroups.com] *On > Behalf Of *Dimitri CHARLES
> *Sent:* 14 November 2012 09:11
> *To:* jenkin...@googlegroups.com
> *Subject:* Calling a maven instance from a plugin
> Hi, I am actually writing a plugin where I want to pass some customs > parameters, goals
> to a maven instance. For instance, some profiles, some properties > contained in a POM (-Dproperty=value).
> and I instantiate this property with my custom goals. In my perform > method, I call maven.perform().
> For the AbstractMavenBuilder, I discovered it yesterday and I was > thinking to extend this class.
> Is this a better way to do that? Can you show an example how to call a > maven instance from a plugin?
> Thanks for your suggestion
> ------------------------------
> *************************************************************************** ***********
> This message is confidential and intended only for the addressee. If you > have received this message in error, please immediately notify the > postm...@nds.com and delete it from your system as well as any copies. > The content of e-mails as well as traffic data may be monitored by NDS for > employment and security purposes. To protect the environment please do not > print this e-mail unless necessary.
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 > 4EX, United Kingdom. A company registered in England and Wales. Registered > no. 3080780. VAT no. GB 603 8808 40-00
> *************************************************************************** ***********
> This message is confidential and intended only for the addressee. If you > have received this message in error, please immediately notify the > postm...@nds.com and delete it from your system as well as any copies. > The content of e-mails as well as traffic data may be monitored by NDS for > employment and security purposes. To protect the environment please do not > print this e-mail unless necessary.
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 > 4EX, United Kingdom. A company registered in England and Wales. Registered > no. 3080780. VAT no. GB 603 8808 40-00
> *************************************************************************** ***********
> This message is confidential and intended only for the addressee. If you > have received this message in error, please immediately notify the > postm...@nds.com <javascript:> and delete it from your system as well as > any copies. The content of e-mails as well as traffic data may be monitored > by NDS for employment and security purposes. To protect the environment > please do not print this e-mail unless necessary.
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 > 4EX, United Kingdom. A company registered in England and Wales. Registered > no. 3080780. VAT no. GB 603 8808 40-00
Hi James, I finally corrected my mistakes. In fact, in the setUp, instead of returning a new Environment, I just called the super.setUp and that gave the error show above.
And now, I am returning a new Environment and everything works. Thanks for your help !!
Le mercredi 14 novembre 2012 18:03:19 UTC+1, Dimitri CHARLES a écrit :
> Thanks for your advice !!
> Le mercredi 14 novembre 2012 16:04:02 UTC+1, teilo a écrit :
>> It uses the getGoalsAndOptions rather than the intercept.
>> Intercept is more for adding extra options, getGotalsAndOptions is used >> to change the default goals that run (the ones that are normally entered in >> the UI).
>> *From:* jenkin...@googlegroups.com [mailto:jenkin...@googlegroups.com] *On >> Behalf Of *Dimitri CHARLES
>> *Sent:* 14 November 2012 14:37
>> *To:* jenkin...@googlegroups.com
>> *Subject:* Re: Calling a maven instance from a plugin
>> Hi James,
>> Thanks for your answer.
>> I watched and it seems that I have to implement >> MavenArgumentInterceptorAction.
>> But in the class M2ReleaseArgumentInterceptorAction, why dont implement >> the intercept method?
>> Le mercredi 14 novembre 2012 13:04:45 UTC+1, teilo a écrit :
>> Hi Dimitri,
>> Don’t use it – just look at the code which will give you an example of >> changing the goals.
>> /James
>> *From:* jenkin...@googlegroups.com [mailto:jenkin...@googlegroups.com] *On >> Behalf Of *Dimitri CHARLES
>> *Sent:* 14 November 2012 11:57
>> *To:* jenkin...@googlegroups.com
>> *Subject:* Re: Calling a maven instance from a plugin
>> Hi James,
>> Thanks for your answer.
>> How can I use this plugin. I see that it is used to perform Maven >> release. Can you give me an example how can I use it?
>> Thanks
>> Le mercredi 14 novembre 2012 12:29:14 UTC+1, teilo a écrit :
>> Take a look at the m2release plugin – you can dynamically (and >> optionally) change the default goals that get passed to maven in a plugin.
>> /James
>> *From:* jenkin...@googlegroups.com [mailto:jenkin...@googlegroups.com] *On >> Behalf Of *Dimitri CHARLES
>> *Sent:* 14 November 2012 09:11
>> *To:* jenkin...@googlegroups.com
>> *Subject:* Calling a maven instance from a plugin
>> Hi, I am actually writing a plugin where I want to pass some customs >> parameters, goals
>> to a maven instance. For instance, some profiles, some properties >> contained in a POM (-Dproperty=value).
>> and I instantiate this property with my custom goals. In my perform >> method, I call maven.perform().
>> For the AbstractMavenBuilder, I discovered it yesterday and I was >> thinking to extend this class.
>> Is this a better way to do that? Can you show an example how to call a >> maven instance from a plugin?
>> Thanks for your suggestion
>> ------------------------------
>> *************************************************************************** ***********
>> This message is confidential and intended only for the addressee. If you >> have received this message in error, please immediately notify the >> postm...@nds.com and delete it from your system as well as any copies. >> The content of e-mails as well as traffic data may be monitored by NDS for >> employment and security purposes. To protect the environment please do not >> print this e-mail unless necessary.
>> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 >> 4EX, United Kingdom. A company registered in England and Wales. Registered >> no. 3080780. VAT no. GB 603 8808 40-00
>> *************************************************************************** ***********
>> This message is confidential and intended only for the addressee. If you >> have received this message in error, please immediately notify the >> postm...@nds.com and delete it from your system as well as any copies. >> The content of e-mails as well as traffic data may be monitored by NDS for >> employment and security purposes. To protect the environment please do not >> print this e-mail unless necessary.
>> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 >> 4EX, United Kingdom. A company registered in England and Wales. Registered >> no. 3080780. VAT no. GB 603 8808 40-00
>> *************************************************************************** ***********
>> This message is confidential and intended only for the addressee. If you >> have received this message in error, please immediately notify the >> postm...@nds.com and delete it from your system as well as any copies. >> The content of e-mails as well as traffic data may be monitored by NDS for >> employment and security purposes. To protect the environment please do not >> print this e-mail unless necessary.
>> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 >> 4EX, United Kingdom. A company registered in England and Wales. Registered >> no. 3080780. VAT no. GB 603 8808 40-00