Re: Plugin phase awareness...
https://github.com/apache/maven/blob/maven-3.1.1/maven-core/src/main/java/org/apache/maven/plugin/MojoExecution.java#L160 ... and, like I said, the example I pasted elsewhere in this thread does work in maven 3.0.5 and 3.1.1. -- Regards, Igor On 12/24/2013, 18:01, Martin Gainty wrote: not found in 3.1.1 ${user.home}\org\apache\maven\maven-core\3.1.1\jar>javap .\or g\apache\maven\plugin\MojoExecution | grep lifecyclePhase Warning: Binary file .\org\apache\maven\plugin\MojoExecution contains org.apache.maven.plugin.MojoExecution I have 3.1.1 fully operational but I cannt locate the lifecyclePhase in MojoExecution I *thought* 3.1.1 was latest...does anyone know where the lifecyclePhase attribute is located? Thanks! Martin __ God jul till alla och From: mgai...@hotmail.com To: dev@maven.apache.org Subject: RE: Plugin phase awareness... Date: Tue, 24 Dec 2013 08:01:01 -0500 mvn version 3.0.2 public class CompilerMojo extends AbstractCompilerMojo { /** * @parameter expression="${mojoExecution}" */ @Parameter(defaultValue = "${mojoExecution}") private org.apache.maven.plugin.MojoExecution execution; public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } /** * @parameter expression="${mojoExecution.lifecyclePhase}" */ @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") private String executionPhase; public String getExecutionPhase() { return executionPhase; } public void execute() throws MojoExecutionException, CompilationFailureException { getLog().info("CompilerMojo::execute LINE 135 Current Execution is "+getExecution()); getLog().info("CompilerMojo::execute LINE 136 Current Execution phase is "+getExecutionPhase()); ... } .. } [info] CompilerMojo::execute LINE 135 Current Execution is null [info] CompilerMojo::execute LINE 136 Current Execution phase is null i cant seem to get this to work in 3.0.2...let me try 3.11 thanks, Martin Date: Tue, 24 Dec 2013 02:53:06 +0100 Subject: Re: Plugin phase awareness... From: lennart.jore...@gmail.com To: dev@maven.apache.org Try just injecting the mojoExecution object. Then invoke the getLifecyclePhase() method in it. 2013/12/24 Martin Gainty Igor/Tamas a quick test package org.apache.maven.plugin; public class CompilerMojo extends AbstractCompilerMojo { @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") private String executionPhase; public String getExecutionPhase() { return executionPhase; } public void execute() throws MojoExecutionException, CompilationFailureException { getLog().info("CompilerMojo::execute LINE 136 Current phase is "+getExecutionPhase()); } } [info] CompilerMojo::execute LINE 136 Current phase is null does this work in all versions of maven...if not which versions can i implement mojoExecution.lifecyclePhase ? Martin __ Jogi és Bizalmassági kinyilatkoztatás Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet tartalma miatt. From: ta...@cservenak.net Date: Mon, 23 Dec 2013 11:04:58 +0100 Subject: Re: Plugin phase awareness... To: dev@maven.apache.org Here is an example, same as proposed by Igor https://github.com/sonatype/nexus-maven-plugins/blob/master/staging/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/AbstractStagingMojo.java#L72 Still, you need to be careful if you want maven 2.x, maven 3.0.x and maven 3.1.x compatibility, as some methods did change around here. Just skim the javadoc comments. HTH, ~t~ On Sat, Dec 21, 2013 at 3:27 PM, Igor Fedorenko wrote: Something like this should do the trick @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") private String executionPhase; other "magic" properties available to mojos are documented in [1] [1] http://maven.apache.org/ref/3.1.1/maven-core/apidocs/org/ apache/maven/plugin/PluginParameterExpressionEvaluator.html -- Regards, Igor On 12/21/2013, 3:52, Lennart Jörelid wrote: Hello all, How can a running Mojo query the Maven API (or some other API) to find out which Maven Phase it has been invoked in? Something like ... String currentPhase = getSomeMavenApiHelper().getCurrentPhase(); -- +==+ | Bästa hälsningar, | [sw. "Best regards"] | | Lennart Jörelid | EAI Architect & Integrator | | jGuru Europe AB | Mölnlycke - Kista | | Email: l...@jguru.se | URL: www.jguru.se | Phone | (skype): jgurueurope | (intl): +46 708 507 603 | (domestic): 0708 - 507 603 +==+ - To unsubscribe, e-mail: dev-unsubscr...@
RE: Plugin phase awareness...
not found in 3.1.1 ${user.home}\org\apache\maven\maven-core\3.1.1\jar>javap .\or g\apache\maven\plugin\MojoExecution | grep lifecyclePhase Warning: Binary file .\org\apache\maven\plugin\MojoExecution contains org.apache.maven.plugin.MojoExecution I have 3.1.1 fully operational but I cannt locate the lifecyclePhase in MojoExecution I *thought* 3.1.1 was latest...does anyone know where the lifecyclePhase attribute is located? Thanks! Martin __ God jul till alla och > From: mgai...@hotmail.com > To: dev@maven.apache.org > Subject: RE: Plugin phase awareness... > Date: Tue, 24 Dec 2013 08:01:01 -0500 > > mvn version 3.0.2 > > > > public class CompilerMojo extends AbstractCompilerMojo > > { > > /** > * @parameter expression="${mojoExecution}" > */ > @Parameter(defaultValue = "${mojoExecution}") > private org.apache.maven.plugin.MojoExecution execution; > public org.apache.maven.plugin.MojoExecution getExecution() { return > execution; } > > > > /** > * @parameter expression="${mojoExecution.lifecyclePhase}" > */ > @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") > private String executionPhase; > public String getExecutionPhase() { return executionPhase; } > > > public void execute() throws MojoExecutionException, > CompilationFailureException > { > getLog().info("CompilerMojo::execute LINE 135 Current Execution is > "+getExecution()); > getLog().info("CompilerMojo::execute LINE 136 Current Execution phase is > "+getExecutionPhase()); > ... > > } > > .. > > } > > [info] CompilerMojo::execute LINE 135 Current Execution is null > [info] CompilerMojo::execute LINE 136 Current Execution phase is null > > > i cant seem to get this to work in 3.0.2...let me try 3.11 > > > > thanks, > Martin > > > > > > > Date: Tue, 24 Dec 2013 02:53:06 +0100 > > Subject: Re: Plugin phase awareness... > > From: lennart.jore...@gmail.com > > To: dev@maven.apache.org > > > > Try just injecting the mojoExecution object. > > Then invoke the getLifecyclePhase() method in it. > > > > > > 2013/12/24 Martin Gainty > > > > > Igor/Tamas > > > a quick test > > > > > > package org.apache.maven.plugin; > > > public class CompilerMojo extends AbstractCompilerMojo > > > { > > > @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") > > > private String executionPhase; > > > public String getExecutionPhase() { return executionPhase; } > > > > > > > > > public void execute() throws MojoExecutionException, > > > CompilationFailureException > > > { > > > getLog().info("CompilerMojo::execute LINE 136 Current phase is > > > "+getExecutionPhase()); > > > > > > > > > } > > > > > > } > > > [info] CompilerMojo::execute LINE 136 Current phase is null > > > > > > > > > > > > does this work in all versions of maven...if not which versions can i > > > implement mojoExecution.lifecyclePhase > > > > > > ? > > > Martin > > > __ > > > Jogi és Bizalmassági kinyilatkoztatás > > > > > > > > > Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, > > > hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának > > > készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és > > > semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek > > > könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet > > > ezen > > > üzenet tartalma miatt. > > > > > > > > > > > > > > > > > > > From: ta...@cservenak.net > > > > Date: Mon, 23 Dec 2013 11:04:58 +0100 > > > > Subject: Re: Plugin phase awareness... > > > > To: dev@maven.apache.org > > > > > > > > Here is an example, same as proposed by Igor > > > > > > > https://github.com/sonatype/nexus-maven-plugins/blob/master/staging/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/AbstractStagingMojo.java#L72 > > > > > > > > Still, you need to be careful if you want maven 2.x, maven 3.0.x and > > > maven > > > > 3.1.x compatibility, as some methods did change around here. > > > > Just skim the javadoc comments. > > > > > > > > > > > > HTH, > > > > ~t~ > > > > > > > > > > > > On Sat, Dec 21, 2013 at 3:27 PM, Igor Fedorenko > > > wrote: > > > > > > > > > Something like this should do the trick > > > > > > > > > > @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") > > > > > private String executionPhase; > > > > > > > > > > other "magic" properties available to mojos are documented in [1] > > > > > > > > > > [1] http://maven.apache.org/ref/3.1.1/maven-core/apidocs/org/ > > > > > apache/maven/plugin/PluginParameterExpressionEvaluator.html > > > > > > > > > > -- > > > > > Regards, > > > > > Igor > > > > > > > > > > > > > > > > > > > > On 12/21/2013, 3:52, Lennart Jörelid wrote: > > > > > > > > > >> Hello all, > > > > >> > > > > >> How can a running Mojo query the Maven API (or some other API) to > > > find out > > > > >> which Maven Phase it has been invoked in? Something like ... >
Re: [VOTE] Apache Maven SCM 1.9 (take 2)
Hi, I've fixed SCM-737, which means that the source-releases.zip should match all the files project files again. If I'm correct this means that the reason for the -1 vote has been solved. However, on my Windows machine I don't get the test for the maven-scm-plugin to succeed. The svnadmin fails to create/load a repository. I've tried svn 1.6, 1.7 and 1.8, all failing with equivalent failures. Could somebody else verify the current trunk? thanks, Robert Op Tue, 03 Dec 2013 03:10:39 +0100 schreef Hervé BOUTEMY : http://jira.codehaus.org/browse/SCM-737 created Le mardi 3 décembre 2013 03:05:17 Hervé BOUTEMY a écrit : +1 need to find a workaround for CVS provider unit tests later Regards, Hervé Le lundi 2 décembre 2013 19:38:41 Olivier Lamy a écrit : > Hi, > > We fixed 11 issues. The new feature is the jgit provider (based on jgit). > Details: > http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10527&version=1 > 87 83 > > Staging repository: > https://repository.apache.org/content/repositories/maven-002/ > > Staged site: http://maven.apache.org/scm-archives/scm-LATEST/ > > Sources release: > https://repository.apache.org/content/repositories/maven-002/org/apache/ma > ve n/scm/maven-scm/1.9/maven-scm-1.9-source-release.zip > > Vote open for 72H > > [+1] > [0] > [-1] > > Thanks - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
RE: Plugin phase awareness...
mvn version 3.0.2 public class CompilerMojo extends AbstractCompilerMojo { /** * @parameter expression="${mojoExecution}" */ @Parameter(defaultValue = "${mojoExecution}") private org.apache.maven.plugin.MojoExecution execution; public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } /** * @parameter expression="${mojoExecution.lifecyclePhase}" */ @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") private String executionPhase; public String getExecutionPhase() { return executionPhase; } public void execute() throws MojoExecutionException, CompilationFailureException { getLog().info("CompilerMojo::execute LINE 135 Current Execution is "+getExecution()); getLog().info("CompilerMojo::execute LINE 136 Current Execution phase is "+getExecutionPhase()); ... } .. } [info] CompilerMojo::execute LINE 135 Current Execution is null [info] CompilerMojo::execute LINE 136 Current Execution phase is null i cant seem to get this to work in 3.0.2...let me try 3.11 thanks, Martin > Date: Tue, 24 Dec 2013 02:53:06 +0100 > Subject: Re: Plugin phase awareness... > From: lennart.jore...@gmail.com > To: dev@maven.apache.org > > Try just injecting the mojoExecution object. > Then invoke the getLifecyclePhase() method in it. > > > 2013/12/24 Martin Gainty > > > Igor/Tamas > > a quick test > > > > package org.apache.maven.plugin; > > public class CompilerMojo extends AbstractCompilerMojo > > { > > @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") > > private String executionPhase; > > public String getExecutionPhase() { return executionPhase; } > > > > > > public void execute() throws MojoExecutionException, > > CompilationFailureException > > { > > getLog().info("CompilerMojo::execute LINE 136 Current phase is > > "+getExecutionPhase()); > > > > > > } > > > > } > > [info] CompilerMojo::execute LINE 136 Current phase is null > > > > > > > > does this work in all versions of maven...if not which versions can i > > implement mojoExecution.lifecyclePhase > > > > ? > > Martin > > __ > > Jogi és Bizalmassági kinyilatkoztatás > > > > > > Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, > > hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának > > készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és > > semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek > > könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen > > üzenet tartalma miatt. > > > > > > > > > > > > > From: ta...@cservenak.net > > > Date: Mon, 23 Dec 2013 11:04:58 +0100 > > > Subject: Re: Plugin phase awareness... > > > To: dev@maven.apache.org > > > > > > Here is an example, same as proposed by Igor > > > > > https://github.com/sonatype/nexus-maven-plugins/blob/master/staging/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/AbstractStagingMojo.java#L72 > > > > > > Still, you need to be careful if you want maven 2.x, maven 3.0.x and > > maven > > > 3.1.x compatibility, as some methods did change around here. > > > Just skim the javadoc comments. > > > > > > > > > HTH, > > > ~t~ > > > > > > > > > On Sat, Dec 21, 2013 at 3:27 PM, Igor Fedorenko > > wrote: > > > > > > > Something like this should do the trick > > > > > > > > @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}") > > > > private String executionPhase; > > > > > > > > other "magic" properties available to mojos are documented in [1] > > > > > > > > [1] http://maven.apache.org/ref/3.1.1/maven-core/apidocs/org/ > > > > apache/maven/plugin/PluginParameterExpressionEvaluator.html > > > > > > > > -- > > > > Regards, > > > > Igor > > > > > > > > > > > > > > > > On 12/21/2013, 3:52, Lennart Jörelid wrote: > > > > > > > >> Hello all, > > > >> > > > >> How can a running Mojo query the Maven API (or some other API) to > > find out > > > >> which Maven Phase it has been invoked in? Something like ... > > > >> > > > >> String currentPhase = getSomeMavenApiHelper().getCurrentPhase(); > > > >> > > > >> -- > > > >> +==+ > > > >> | Bästa hälsningar, > > > >> | [sw. "Best regards"] > > > >> | > > > >> | Lennart Jörelid > > > >> | EAI Architect & Integrator > > > >> | > > > >> | jGuru Europe AB > > > >> | Mölnlycke - Kista > > > >> | > > > >> | Email: l...@jguru.se > > > >> | URL: www.jguru.se > > > >> | Phone > > > >> | (skype): jgurueurope > > > >> | (intl): +46 708 507 603 > > > >> | (domestic): 0708 - 507 603 > > > >> +==+ > > > >> > > > >> > > > > - > > > > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org > > > > For additional commands, e-mail: dev-h...@maven.apache.org > > > > > > > > > > > > > > > > -- > > -- > +==+ > | Bästa hälsningar, > | [sw. "Best regards"] >