maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anders Hammar (JIRA)" <j...@codehaus.org>
Subject [jira] (MNG-5555) @parameter expression="${mojoExecution.lifecyclePhase}" does not work in 3.1.1
Date Wed, 01 Jan 2014 14:26:45 GMT

     [ https://jira.codehaus.org/browse/MNG-5555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Anders Hammar reopened MNG-5555:
--------------------------------

    
> @parameter expression="${mojoExecution.lifecyclePhase}" does not work in 3.1.1
> ------------------------------------------------------------------------------
>
>                 Key: MNG-5555
>                 URL: https://jira.codehaus.org/browse/MNG-5555
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Multiple Language Support
>    Affects Versions: 3.1.0-alpha-1
>         Environment: JDK 1.7.0.25
> maven 3.1.1
>            Reporter: Martin Gainty
>            Priority: Minor
>             Fix For: 3.1.x
>
>
> Maven-core:3.1.1
> /**
>   * @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 lifecyclePhase;
> public org.apache.maven.model.Plugin plugin=new org.apache.maven.model.Plugin();
> public String getLifecyclePhase()
> {
> 	if(lifecyclePhase==null)
> 	{
> 		plugin.setGroupId("org.apache.maven.plugins");
> 		plugin.setArtifactId("maven-compiler-plugin");
> 		plugin.setVersion("3.1");
> 		String goal="compile";
> 		String executionId="executionId";
> 		System.out.println("CompilerMojoTestCase::getLifecyclePhase goal="+goal+" executionId="+executionId);
> 		org.apache.maven.plugin.MojoExecution mojo=new org.apache.maven.plugin.MojoExecution((org.apache.maven.model.Plugin)plugin,
goal, executionId );
> 		lifecyclePhase= mojo.getLifecyclePhase();
> 	}
> 	return lifecyclePhase;
> }
> produces:
> CompilerMojoTestCase::getLifecyclePhase goal=compile executionId=executionId
> CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     null
> I am using 3.1.1 jars top to botton
> why does lifecyclePhase always produce null?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message