Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Calling a maven instance from a plugin
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dimitri CHARLES  
View profile  
 More options Nov 14 2012, 4:11 am
From: Dimitri CHARLES <charles2000dimi...@gmail.com>
Date: Wed, 14 Nov 2012 01:11:12 -0800 (PST)
Local: Wed, Nov 14 2012 4:11 am
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).

I tried to look in the jenkins code and I see that the class
hudson.tasks.Maven <http://javadoc.jenkins-ci.org/hudson/tasks/Maven.html> could
help me. But I also see there is the

class AbstractMavenBuilder<http://javadoc.jenkins-ci.org/hudson/maven/AbstractMavenBuilder.html>.
The idea that I have for the first one is I have a maven property (type of
Maven) in my plugin (my plugin is a class that extends Builder),

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nord, James  
View profile  
 More options Nov 14 2012, 6:29 am
From: "Nord, James" <JN...@nds.com>
Date: Wed, 14 Nov 2012 11:28:52 +0000
Local: Wed, Nov 14 2012 6:28 am
Subject: RE: Calling a maven instance from a plugin

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).

I tried to look in the jenkins code and I see that the class hudson.tasks.Maven<http://javadoc.jenkins-ci.org/hudson/tasks/Maven.html> could help me. But I also see there is the

class AbstractMavenBuilder<http://javadoc.jenkins-ci.org/hudson/maven/AbstractMavenBuilder.html>. The idea that I have for the first one is I have a maven property (type of Maven) in my plugin (my plugin is a class that extends Builder),

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
*************************************************************************** ***********


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dimitri CHARLES  
View profile  
 More options Nov 14 2012, 6:56 am
From: Dimitri CHARLES <charles2000dimi...@gmail.com>
Date: Wed, 14 Nov 2012 03:56:48 -0800 (PST)
Local: Wed, Nov 14 2012 6:56 am
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 :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nord, James  
View profile  
 More options Nov 14 2012, 7:04 am
From: "Nord, James" <JN...@nds.com>
Date: Wed, 14 Nov 2012 12:04:16 +0000
Local: Wed, Nov 14 2012 7:04 am
Subject: RE: Calling a maven instance from a plugin

Hi Dimitri,

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).

I tried to look in the jenkins code and I see that the class hudson.tasks.Maven<http://javadoc.jenkins-ci.org/hudson/tasks/Maven.html> could help me. But I also see there is the

class AbstractMavenBuilder<http://javadoc.jenkins-ci.org/hudson/maven/AbstractMavenBuilder.html>. The idea that I have for the first one is I have a maven property (type of Maven) in my plugin (my plugin is a class that extends Builder),

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
*************************************************************************** ***********


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dimitri CHARLES  
View profile  
 More options Nov 14 2012, 9:37 am
From: Dimitri CHARLES <charles2000dimi...@gmail.com>
Date: Wed, 14 Nov 2012 06:37:05 -0800 (PST)
Local: Wed, Nov 14 2012 9:37 am
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 :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nord, James  
View profile  
 More options Nov 14 2012, 10:04 am
From: "Nord, James" <JN...@nds.com>
Date: Wed, 14 Nov 2012 15:03:36 +0000
Local: Wed, Nov 14 2012 10:03 am
Subject: RE: Calling a maven instance from a plugin

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).

See https://github.com/jenkinsci/jenkins/blob/master/maven-plugin/src/mai...

/James

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).

I tried to look in the jenkins code and I see that the class hudson.tasks.Maven<http://javadoc.jenkins-ci.org/hudson/tasks/Maven.html> could help me. But I also see there is the

class AbstractMavenBuilder<http://javadoc.jenkins-ci.org/hudson/maven/AbstractMavenBuilder.html>. The idea that I have for the first one is I have a maven property (type of Maven) in my plugin (my plugin is a class that extends Builder),

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
*************************************************************************** ***********


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dimitri CHARLES  
View profile  
 More options Nov 14 2012, 12:03 pm
From: Dimitri CHARLES <charles2000dimi...@gmail.com>
Date: Wed, 14 Nov 2012 09:03:19 -0800 (PST)
Local: Wed, Nov 14 2012 12:03 pm
Subject: Re: Calling a maven instance from a plugin

Hi James,

Thanks for your answer. I am able to pass my custom variable to maven but
when I am launching a build, I have a strange error :

saying  :

*Building in workspace D:\workspace2\remote-deployment-new\work\jobs\Maven\workspace
FATAL: The plugin 'com.ebiznext.plugins.RemoteDeploymentWrapper' still uses deprecated setUp(Build,Launcher,BuildListener) method. Update the plugin to use setUp(AbstractBuild, Launcher, BuildListener) instead.java.lang.AssertionError <http://stacktrace.jenkins-ci.org/search?query=java.lang.AssertionError>: The plugin 'com.ebiznext.plugins.RemoteDeploymentWrapper' still uses deprecated setUp(Build,Launcher,BuildListener) method. Update the plugin to use setUp(AbstractBuild, Launcher, BuildListener) instead.
        at hudson.tasks.BuildWrapper.setUp(BuildWrapper.java:144) <http://stacktrace.jenkins-ci.org/search/?query=hudson.tasks.BuildWrap...>
        at com.ebiznext.plugins.RemoteDeploymentWrapper.setUp(RemoteDeploymentWrapper. java:100) <http://stacktrace.jenkins-ci.org/search/?query=com.ebiznext.plugins.R...>
        at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenMo duleSetBuild.java:601) <http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenModu...>
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:58 6) <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractB...>
*

It's strange because I have implemented the correct method, not the
deprecated one :

*public class RemoteDeploymentWrapper extends BuildWrapper {
*
*
*
*  ....*
*
*
*public Environment setUp(@SuppressWarnings("rawtypes") AbstractBuild
build, Launcher launcher, final BuildListener listener)*
*            throws IOException,*
*            InterruptedException {*
*         .......*
*   } *
*}*

Thanks for your advice !!
Le mercredi 14 novembre 2012 16:04:02 UTC+1, teilo a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dimitri CHARLES  
View profile  
 More options Nov 14 2012, 7:15 pm
From: Dimitri CHARLES <charles2000dimi...@gmail.com>
Date: Wed, 14 Nov 2012 16:15:48 -0800 (PST)
Local: Wed, Nov 14 2012 7:15 pm
Subject: Re: Calling a maven instance from a plugin

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 :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »