You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Lennart Jörelid <le...@gmail.com> on 2013/12/21 09:52:56 UTC

Plugin phase awareness...

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: lj@jguru.se
| URL:   www.jguru.se
| Phone
| (skype):    jgurueurope
| (intl):     +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+

RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
bash>mvn help:effective-pom | grep phase
            <phase>site-deploy</phase>
            <phase>package</phase>
            <phase>generate-resources</phase>
            <phase>site</phase>
            <phase>site-deploy</phase>
            <phase>test</phase>
            <phase>test-compile</phase>
            <phase>compile</phase>
            <phase>clean</phase>
            <phase>install</phase>
            <phase>process-resources</phase>
            <phase>process-test-resources</phase>
            <phase>package</phase>
            <phase>deploy</phase>


?
Martin 
______________________________________________ 


Inte förändra och störa detta meddelande


  



> Date: Sat, 21 Dec 2013 09:52:56 +0100
> Subject: Plugin phase awareness...
> From: lennart.jorelid@gmail.com
> To: dev@maven.apache.org
> 
> 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: lj@jguru.se
> | URL: www.jguru.se
> | Phone
> | (skype): jgurueurope
> | (intl): +46 708 507 603
> | (domestic): 0708 - 507 603
> +==============================+
 		 	   		  

RE: Plugin phase awareness...

Posted by Robert Patrick <ro...@oracle.com>.
I downloaded Maven 3.0.2 and my tests also work (still using JDK 7u45):

C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn -version
Apache Maven 3.0.2 (r1056850; 2011-01-08 18:58:10-0600)
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: c:\java\jdk1.7.0\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building lifecycle-phase-plugin-test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (validate-phase) @ lifecycle-p
hase-plugin-test ---
[INFO] [phase-name] Maven lifecycle phase is validate
[INFO]
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (compile-phase) @ lifecycle-ph
ase-plugin-test ---
[INFO] [phase-name] Maven lifecycle phase is compile
[INFO]
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (process-classes-phase) @ life
cycle-phase-plugin-test ---
[INFO] [phase-name] Maven lifecycle phase is process-classes
[INFO]
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (package-phase) @ lifecycle-ph
ase-plugin-test ---
[INFO] [phase-name] Maven lifecycle phase is package
[INFO]
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (pre-integration-test-phase) @
 lifecycle-phase-plugin-test ---
[INFO] [phase-name] Maven lifecycle phase is pre-integration-test
[INFO]
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (post-integration-test-phase)
@ lifecycle-phase-plugin-test ---
[INFO] [phase-name] Maven lifecycle phase is post-integration-test
[INFO]
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (verify-phase) @ lifecycle-pha
se-plugin-test ---
[INFO] [phase-name] Maven lifecycle phase is verify
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ lifecycle-phas
e-plugin-test ---
[INFO] Installing C:\rpatrick\work\src\maven\lifecycle-phase\test-project\pom.xm
l to C:\Users\rpatrick\.m2\repository\test\lifecycle-phase-plugin-test\1.0-SNAPS
HOT\lifecycle-phase-plugin-test-1.0-SNAPSHOT.pom
[INFO]
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (install-phase) @ lifecycle-ph
ase-plugin-test ---
[INFO] [phase-name] Maven lifecycle phase is install
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.217s
[INFO] Finished at: Tue Dec 31 08:14:07 CST 2013
[INFO] Final Memory: 13M/490M
[INFO] ------------------------------------------------------------------------


--
Robert Patrick <ro...@oracle.com>
VP, FMW Platform Architecture
Oracle Corporation			Office: +1.940.725.0011
1148 Triple Crown Court			Fax: +1.940.725.0012
Bartonville, TX 76226, USA		Mobile: +1.469.556.9450

Professional Oracle WebLogic Server
by Robert Patrick, Gregory Nyberg, and Philip Aston
with Josh Bregman and Paul Done
Book Home Page: http://www.wrox.com/
Kindle Version: http://www.amazon.com/


-----Original Message-----
From: Stuart McCulloch [mailto:mcculls@gmail.com] 
Sent: Tuesday, December 31, 2013 8:05 AM
To: Maven Developers List
Subject: Re: Plugin phase awareness...

On 31 Dec 2013, at 12:51, Martin Gainty <mg...@hotmail.com> wrote:

> --_d7af7d72-ddaf-4bb4-8989-06a73d80616e_
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> [DEBUG] test:lifecycle-phases-plugin:jar:1.0:
> [DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-model:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-artifact:jar:3.0:compile
> [DEBUG]       org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
> [DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
> [DEBUG]             org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
> [DEBUG]    org.apache.maven:maven-core:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-settings:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-settings-builder:jar:3.0:compile
> [DEBUG]          org.codehaus.mojo:animal-sniffer:jar:1.6:compile
> [DEBUG]             asm:asm-all:jar:3.1:compile
> [DEBUG]          org.codehaus.plexus:plexus-component-metadata:jar:1.5.4:co=
> mpile
> [DEBUG]             org.codehaus.plexus:plexus-container-default:jar:1.5.4:=
> compile
> [DEBUG]                org.apache.xbean:xbean-reflect:jar:3.4:compile
> [DEBUG]                   log4j:log4j:jar:1.2.12:compile
> [DEBUG]                   commons-logging:commons-logging-api:jar:1.1:compi=
> le
> [DEBUG]                com.google.collections:google-collections:jar:1.0:co=
> mpile
> [DEBUG]                junit:junit:jar:3.8.2:compile
> [DEBUG]             com.thoughtworks.qdox:qdox:jar:1.9.2:compile
> [DEBUG]             jdom:jdom:jar:1.0:compile
> [DEBUG]             org.apache.maven:maven-project:jar:2.0.9:compile
> [DEBUG]                org.apache.maven.plugin-tools:maven-plugin-tools-api=
> :jar:3.0:compile
> [DEBUG]                   org.apache.maven:maven-plugin-descriptor:jar:2.2.=
> 1:compile
> [DEBUG]                org.apache.maven:maven-profile:jar:2.0.9:compile
> [DEBUG]                org.apache.maven:maven-artifact-manager:jar:2.0.9:co=
> mpile
> [DEBUG]                org.apache.maven:maven-plugin-registry:jar:2.0.9:com=
> pile
> [DEBUG]             org.codehaus.plexus:plexus-cli:jar:1.2:compile
> [DEBUG]             commons-cli:commons-cli:jar:1.0:compile
> [DEBUG]                commons-logging:commons-logging:jar:1.0:compile
> [DEBUG]                commons-lang:commons-lang:jar:1.0:compile
> [DEBUG]             asm:asm:jar:3.1:compile
> [DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-model-builder:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-aether-provider:jar:3.0:runtime
> [DEBUG]       org.sonatype.aether:aether-impl:jar:1.7:compile
> [DEBUG]          org.apache.maven.plugins:maven-surefire-plugin:jar:2.4.2:c=
> ompile
> [DEBUG]             org.apache.maven.surefire:surefire-booter:jar:2.4.2:com=
> pile
> [DEBUG]                org.apache.maven.surefire:maven-surefire-common:jar:=
> 2.12.4:compile
> [DEBUG]                   org.apache.maven.plugin-tools:maven-plugin-annota=
> tions:jar:3.1:compile
> [DEBUG]                   org.apache.maven:maven-toolchain:jar:2.0.9:compil=
> e
> [DEBUG]                   org.apache.commons:commons-lang3:jar:3.1:compile
> [DEBUG]                   org.apache.maven.shared:maven-common-artifact-fil=
> ters:jar:1.3:compile
> [DEBUG]                org.apache.maven.surefire:surefire-api:jar:2.4.2:com=
> pile
> [DEBUG]             org.apache.maven.surefire:surefire-junit:jar:2.4.2:comp=
> ile
> [DEBUG]          org.sonatype.aether:aether-spi:jar:1.7:compile
> [DEBUG]       org.sonatype.aether:aether-api:jar:1.7:compile
> [DEBUG]       org.sonatype.aether:aether-util:jar:1.7:compile
> [DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
> [DEBUG]       org.codehaus.plexus:plexus-utils:jar:2.0.4:compile
> [DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
> [DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:co=
> mpile
> [DEBUG]       org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
> [DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
> [DEBUG] Created new class realm maven.api [DEBUG] Importing foreign 
> packages into class realm maven.api
> [DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.transfer < plexus.core
> [DEBUG]   Imported: org.apache.maven.exception < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.metadata < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.collection < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.version < plexus.core
> [DEBUG]   Imported: org.apache.maven.monitor < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
> [DEBUG]   Imported: org.apache.maven.repository < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
> [DEBUG]   Imported: org.apache.maven.profiles < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.repository < plexus.core
> [DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
> [DEBUG]   Imported: org.apache.maven.execution < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.artifact < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.spi < plexus.core
> [DEBUG]   Imported: org.apache.maven.reporting < plexus.core
> [DEBUG]   Imported: org.apache.maven.usability < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexu=
> s.core
> [DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
> [DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.graph < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.settings < plexus.core
> [DEBUG]   Imported: org.codehaus.classworlds < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.impl < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.deployment < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserExceptio=
> n < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexu=
> s.core
> [DEBUG]   Imported: org.apache.maven.configuration < plexus.core
> [DEBUG]   Imported: org.apache.maven.cli < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.installation < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
> [DEBUG]   Imported: org.apache.maven.project < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
> [DEBUG]   Imported: org.apache.maven.artifact < plexus.core
> [DEBUG]   Imported: org.apache.maven.model < plexus.core
> [DEBUG]   Imported: org.apache.maven.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.resolution < plexus.core
> [DEBUG]   Imported: org.apache.maven.plugin < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
> [DEBUG] Populating class realm maven.api [DEBUG] Created new class 
> realm plugin>test:lifecycle-phases-plugin:1.0
> [DEBUG] Importing foreign packages into class realm 
> plugin>test:lifecycle-p=
> hases-plugin:1.0
> [DEBUG]   Imported:  < maven.api
> [DEBUG] Populating class realm plugin>test:lifecycle-phases-plugin:1.0
> [DEBUG]   Included: test:lifecycle-phases-plugin:jar:1.0
> [DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
> [DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
> [DEBUG]   Included: org.codehaus.mojo:animal-sniffer:jar:1.6
> [DEBUG]   Included: asm:asm-all:jar:3.1
> [DEBUG]   Included: org.codehaus.plexus:plexus-component-metadata:jar:1.5.4
> [DEBUG]   Included: org.apache.xbean:xbean-reflect:jar:3.4
> [DEBUG]   Included: log4j:log4j:jar:1.2.12
> [DEBUG]   Included: commons-logging:commons-logging-api:jar:1.1
> [DEBUG]   Included: com.google.collections:google-collections:jar:1.0
> [DEBUG]   Included: junit:junit:jar:3.8.2
> [DEBUG]   Included: com.thoughtworks.qdox:qdox:jar:1.9.2
> [DEBUG]   Included: jdom:jdom:jar:1.0
> [DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-tools-api:ja=
> r:3.0
> [DEBUG]   Included: org.codehaus.plexus:plexus-cli:jar:1.2
> [DEBUG]   Included: commons-cli:commons-cli:jar:1.0
> [DEBUG]   Included: commons-logging:commons-logging:jar:1.0
> [DEBUG]   Included: commons-lang:commons-lang:jar:1.0
> [DEBUG]   Included: asm:asm:jar:3.1
> [DEBUG]   Included: org.apache.maven.plugins:maven-surefire-plugin:jar:2.4.=
> 2
> [DEBUG]   Included: org.apache.maven.surefire:surefire-booter:jar:2.4.2
> [DEBUG]   Included: org.apache.maven.surefire:maven-surefire-common:jar:2.1=
> 2.4
> [DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-annotations:=
> jar:3.1
> [DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.1
> [DEBUG]   Included: org.apache.maven.shared:maven-common-artifact-filters:j=
> ar:1.3
> [DEBUG]   Included: org.apache.maven.surefire:surefire-api:jar:2.4.2
> [DEBUG]   Included: org.apache.maven.surefire:surefire-junit:jar:2.4.2
> [DEBUG]   Included: org.sonatype.aether:aether-util:jar:1.7
> [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.4
> [DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.=
> 5.5
> [DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
> [DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-model:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:3.0
> [DEBUG]   Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2
> [DEBUG]   Excluded: org.apache.maven:maven-core:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-settings:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-settings-builder:jar:3.0
> [DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.5.4
> [DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.9
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.2.1
> [DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.9
> [DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
> [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-model-builder:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-aether-provider:jar:3.0
> [DEBUG]   Excluded: org.sonatype.aether:aether-impl:jar:1.7
> [DEBUG]   Excluded: org.apache.maven:maven-toolchain:jar:2.0.9
> [DEBUG]   Excluded: org.sonatype.aether:aether-spi:jar:1.7
> [DEBUG]   Excluded: org.sonatype.aether:aether-api:jar:1.7
> [DEBUG]   Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.2.3
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name 
> from p= lugin realm 
> ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s= 
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' 
> with= basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: validate-phase}
> [DEBUG]   (f) phase =3D validate
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is validate
> 
> MG>(correct)
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (compile-phase) @ 
> lifecyc= le-phase-plugin-test --- [DEBUG] Configuring mojo 
> test:lifecycle-phases-plugin:1.0:phase-name from p= lugin realm 
> ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s= 
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' 
> with= basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: compile-phase}
> [DEBUG]   (f) phase =3D compile
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is compile
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name 
> (process-classes-phase) @= lifecycle-phase-plugin-test --- [DEBUG] 
> Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p= 
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C 
> parent: s= un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' 
> with= basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: process-classes-phase}
> [DEBUG]   (f) phase =3D process-classes
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is process-classes
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (package-phase) @ 
> lifecyc= le-phase-plugin-test --- [DEBUG] Configuring mojo 
> test:lifecycle-phases-plugin:1.0:phase-name from p= lugin realm 
> ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s= 
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' 
> with= basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: package-phase}
> [DEBUG]   (f) phase =3D package
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is package
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name 
> (pre-integration-test-pha=
> se) @ lifecycle-phase-plugin-test ---
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name 
> from p= lugin realm 
> ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s= 
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' 
> with= basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: pre-integration-test-phase}
> [DEBUG]   (f) phase =3D pre-integration-test
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is pre-integration-test
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name 
> (post-integration-test-ph=
> ase) @ lifecycle-phase-plugin-test --- [DEBUG] Configuring mojo 
> test:lifecycle-phases-plugin:1.0:phase-name from p= lugin realm 
> ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s= 
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' 
> with= basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: post-integration-test-phase}
> [DEBUG]   (f) phase =3D post-integration-test
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is post-integration-test
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (verify-phase) @ 
> lifecycl= e-phase-plugin-test --- [DEBUG] Configuring mojo 
> test:lifecycle-phases-plugin:1.0:phase-name from p= lugin realm 
> ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s= 
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' 
> with= basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: verify-phase}
> [DEBUG]   (f) phase =3D verify
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is verify
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ 
> lifecycle= -phase-plugin-test --- [DEBUG] 
> org.apache.maven.plugins:maven-install-plugin:jar:2.3.1:
> [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
> [DEBUG]    org.apache.maven:maven-project:jar:2.0.6:compile
> [DEBUG]       org.apache.maven:maven-settings:jar:2.0.6:compile
> [DEBUG]       org.apache.maven:maven-profile:jar:2.0.6:compile
> [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
> [DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.5.5:compil=
> e
> [DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:2.3.3:compile
> [DEBUG]             org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.3:compile
> [DEBUG]                com.google.guava:guava:jar:13.0.1:compile
> [DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.2.2:compile
> [DEBUG]          org.apache.xbean:xbean-reflect:jar:3.4:compile
> [DEBUG]             log4j:log4j:jar:1.2.12:compile
> [DEBUG]             commons-logging:commons-logging-api:jar:1.1:compile
> [DEBUG]          com.google.collections:google-collections:jar:1.0:compile
> [DEBUG]          junit:junit:jar:4.11:compile
> [DEBUG]             org.hamcrest:hamcrest-core:jar:1.3:compile
> [DEBUG]    org.apache.maven:maven-model:jar:2.0.6:compile
> [DEBUG]    org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
> [DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
> [DEBUG]    org.apache.maven:maven-artifact:jar:2.0.6:compile
> [DEBUG]    org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
> [DEBUG]    org.codehaus.plexus:plexus-digest:jar:1.0:compile
> [DEBUG] Created new class realm 
> plugin>org.apache.maven.plugins:maven-insta=
> ll-plugin:2.3.1
> [DEBUG] Importing foreign packages into class realm 
> plugin>org.apache.maven=
> .plugins:maven-install-plugin:2.3.1
> [DEBUG]   Imported:  < maven.api
> [DEBUG] Populating class realm 
> plugin>org.apache.maven.plugins:maven-instal=
> l-plugin:2.3.1
> [DEBUG]   Included: org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
> [DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.3
> [DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.3
> [DEBUG]   Included: com.google.guava:guava:jar:13.0.1
> [DEBUG]   Included: org.apache.xbean:xbean-reflect:jar:3.4
> [DEBUG]   Included: log4j:log4j:jar:1.2.12
> [DEBUG]   Included: commons-logging:commons-logging-api:jar:1.1
> [DEBUG]   Included: com.google.collections:google-collections:jar:1.0
> [DEBUG]   Included: junit:junit:jar:4.11
> [DEBUG]   Included: org.hamcrest:hamcrest-core:jar:1.3
> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
> [DEBUG]   Included: org.codehaus.plexus:plexus-digest:jar:1.0
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.6
> [DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.5.5
> [DEBUG]   Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.2.2
> [DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.6
> [DEBUG] Configuring mojo 
> org.apache.maven.plugins:maven-install-plugin:2.3.=
> 1:install from plugin realm 
> ClassRealm[plugin>org.apache.maven.plugins:mave=
> n-install-plugin:2.3.1=2C parent: 
> sun.misc.Launcher$AppClassLoader@68ffab0a=
> ]
> [DEBUG] Configuring mojo 
> 'org.apache.maven.plugins:maven-install-plugin:2.3=
> .1:install' with basic configurator -->
> [DEBUG]   (f) artifact =3D test:lifecycle-phase-plugin-test:pom:1.0-SNAPSHO=
> T
> [DEBUG]   (f) attachedArtifacts =3D []
> [DEBUG]   (f) createChecksum =3D false
> [DEBUG]   (f) localRepository =3D        id: local
>      url: file:///C:/Users/mgainty/.m2/repository/
>   layout: none
> 
> [DEBUG]   (f) packaging =3D pom
> [DEBUG]   (f) pomFile =3D C:\Maven-plugin\lifecycle-phase\test-project\pom.=
> xml
> [DEBUG]   (f) updateReleaseInfo =3D false
> [DEBUG] -- end configuration --
> [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 
> for C= :\Users\mgainty\.m2\repository [INFO] Installing 
> C:\Maven-plugin\lifecycle-phase\test-project\pom.xml to C= 
> :\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-test\1.0-SN
> APSHO= T\lifecycle-phase-plugin-test-1.0-SNAPSHOT.pom
> [DEBUG] Installing 
> test:lifecycle-phase-plugin-test:1.0-SNAPSHOT/maven-meta=
> data.xml to 
> C:\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-tes=
> t\1.0-SNAPSHOT\maven-metadata-local.xml
> [DEBUG] Installing test:lifecycle-phase-plugin-test/maven-metadata.xml 
> to C= 
> :\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-test\maven-
> metad=
> ata-local.xml
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (install-phase) @ 
> lifecyc= le-phase-plugin-test --- [DEBUG] Configuring mojo 
> test:lifecycle-phases-plugin:1.0:phase-name from p= lugin realm 
> ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s= 
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' 
> with= basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: install-phase}
> [DEBUG]   (f) phase =3D install
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is install
> MG>(correct)
> 
> so compiling and running with JDK/JVM/JRE 1.7.0_45 does correct the 
> bug I will update JIRA that this only fails with 1.7.0_25 JDK/JVM/JRE 
> (and does= not fail with JDK/JVM/JRE 1.7.0_45)

Patrick's test project works for me with JDK 1.7.0_25 (on OS X) . can you post the failing log? (ie. same as above, but for the failing case)

> https://jira.codehaus.org/browse/MNG-5555
> 
> =20
> 
> I am puzzled why this bug is manifested when compiling and executing 
> with 1=
> .7.0_25=20
> I would appreciate hearing about bug-fixes from the JVM team that were 
> corr= ected in 1.7.0_25 (in the 1.7.0_45 release)
> 
> =20
> 
> Much appreciated Mr Patrick!
> Happy New Year
> 
> Martin Gainty=20
> ______________________________________________=20
> Porfavor..no altere ni interrumpir esta communicacion..Gracias Please 
> ..do not alter or interrupt this communicaction..Thank You
> 
> =20
> 
> 
> 
>> Date: Mon=2C 30 Dec 2013 15:02:05 -0800
>> From: robert.patrick@oracle.com
>> To: mgainty@hotmail.com=3B dev@maven.apache.org
>> Subject: RE: Plugin phase awareness...
>> =20
>> I don't have Maven 3.02 or Java 7u25 handy but as you can see from my 
>> exa=
> mple execution below=2C Maven 3.0.5 and Java 7u45 works fine-that 
> is=2C mul= tiple executions of the plugin in the different lifecycle 
> phases that I hav= e executions declared in my project POM for all 
> return the same value as th= e lifecycle phase).
>> =20
>> =20
>> =20
>> C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn  -version
>> =20
>> Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da=3B 
>> 2013-02-=
> 19 07:51:
>> =20
>> 28-0600)
>> =20
>> Maven home: c:\wls1213\oracle_common\modules\org.apache.maven_3.0.5
>> =20
>> Java version: 1.7.0_45=2C vendor: Oracle Corporation
>> =20
>> Java home: c:\java\jdk1.7.0\jre
>> =20
>> Default locale: en_US=2C platform encoding: Cp1252
>> =20
>> OS name: "windows 7"=2C version: "6.1"=2C arch: "amd64"=2C family: 
>> "windo=
> ws"
>> =20
>> =20
>> =20
>> C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn install
>> =20
>> [INFO] Scanning for projects...
>> =20
>> [INFO]
>> =20
>> [INFO] 
>> ------------------------------------------------------------------=
> ------
>> =20
>> [INFO] Building lifecycle-phase-plugin-test 1.0-SNAPSHOT
>> =20
>> [INFO] 
>> ------------------------------------------------------------------=
> ------
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (validate-phase) @ 
>> life=
> cycle-p
>> =20
>> hase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is validate
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (compile-phase) @ 
>> lifec=
> ycle-ph
>> =20
>> ase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is compile
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name 
>> (process-classes-phase)=
> @ life
>> =20
>> cycle-phase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is process-classes
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (package-phase) @ 
>> lifec=
> ycle-ph
>> =20
>> ase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is package
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name 
>> (pre-integration-test-p=
> hase) @
>> =20
>> lifecycle-phase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is pre-integration-test
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name 
>> (post-integration-test-=
> phase)
>> =20
>> @ lifecycle-phase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is post-integration-test
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (verify-phase) @ 
>> lifecy=
> cle-pha
>> =20
>> se-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is verify
>> =20
>> [INFO]
>> =20
>> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ 
>> lifecyc=
> le-phas
>> =20
>> e-plugin-test ---
>> =20
>> [INFO] Installing 
>> C:\rpatrick\work\src\maven\lifecycle-phase\test-project=
> \pom.xm
>> =20
>> l to 
>> C:\Users\rpatrick\.m2\repository\test\lifecycle-phase-plugin-test\1.=
> 0-SNAPS
>> =20
>> HOT\lifecycle-phase-plugin-test-1.0-SNAPSHOT.pom
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (install-phase) @ 
>> lifec=
> ycle-ph
>> =20
>> ase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is install
>> =20
>> [INFO] 
>> ------------------------------------------------------------------=
> ------
>> =20
>> [INFO] BUILD SUCCESS
>> =20
>> [INFO] 
>> ------------------------------------------------------------------=
> ------
>> =20
>> [INFO] Total time: 0.880s
>> =20
>> [INFO] Finished at: Mon Dec 30 16:55:29 CST 2013
>> =20
>> [INFO] Final Memory: 14M/490M
>> =20
>> [INFO] 
>> ------------------------------------------------------------------=
> ------
>> =20
>> =20
>> =20
>> =20
>> =20
>> =20
>> =20
>> --
>> =20
>> Robert Patrick <HYPERLINK 
>> "mailto:robert.patrick@oracle.com"robert.patric=
> k@oracle.com>
>> =20
>> VP=2C FMW Platform Architecture
>> =20
>> Oracle Corporation                                Office: +1.940.725.0011
>> =20
>> 1148 Triple Crown Court                                 Fax: +1.940.725.0=
> 012
>> =20
>> Bartonville=2C TX 76226=2C USA                    Mobile: +1.469.556.9450
>> =20
>> =20
>> =20
>> HYPERLINK 
>> "http://www.amazon.com/Professional-Oracle-WebLogic-Server-Patr=
> ick/dp/0470484306/"Professional Oracle WebLogic Server
>> =20
>> by Robert Patrick=2C Gregory Nyberg=2C and Philip Aston
>> =20
>> with Josh Bregman and Paul Done
>> =20
>> Book Home Page: HYPERLINK 
>> "http://www.wrox.com/WileyCDA/WroxTitle/Profess=
> ional-Oracle-WebLogic-Server.productCd-0470484306.html"http://www.wrox
> .com/
>> =20
>> Kindle Version: HYPERLINK 
>> "http://www.amazon.com/Professional-Oracle-WebL=
> ogic-Server-ebook/dp/B004HD69J2/"http://www.amazon.com/
>> =20
>> =20
>> =20
>> =20
>> =20
>> From: Martin Gainty [mailto:mgainty@hotmail.com]=20
>> Sent: Monday=2C December 30=2C 2013 3:41 PM
>> To: Maven Developers List=3B Robert Patrick
>> Subject: RE: Plugin phase awareness...
>> =20
>> =20
>> =20
>> operational with JDK-1.6 but compiling and running with Oracle Java 
>> versi=
> on=3D1.7.0.25 reproduces the bug
>> =20
>> JDK: 1.6
>> mvn -version=3D3.0.2
>> maven-core:3.0
>> maven-plugin-annotations:3.2
>> test-project>mvn -e -X -o compile
>> [INFO] [phase-name]  Maven lifecycle phase is compile (correct)
>> =20
>> JDK: 1.6
>> mvn -version =3D3.0.5
>> maven-core:3.0
>> maven-plugin-annotations:3.2
>> test-project>mvn -e -X -o compile
>> [INFO] [phase-name] Maven lifecycle phase is compile (correct)
>> =20
>> JDK: 1.6
>> mvn -version=3D3.1.1
>> maven-core:3.0
>> maven-plugin-annotations:3.2
>> test-project>mvn -e -X -o compile
>> [INFO] [phase-name] Maven lifecycle phase is compile (correct)
>> =20
>> ----------------------------------JDK-1.7.0.25-----------------------
>> ----=
> ---
>> BASH>mvn -version
>> Apache Maven 3.0.2 (r1056850=3B 2011-01-08 19:58:10-0500) Java 
>> version: 1.7.0_25=2C vendor: Oracle Corporation Java home: 
>> jdk1.7.0_25/jre Default locale: en_US=2C platform encoding: Cp1252 OS 
>> name: "windows 7"=2C version: "6.1"=2C arch: "amd64"=2C family: 
>> "windo=
> ws"
>> =20
>> mvn -version=3D3.0.2
>> maven-core:3.0
>> maven-plugin-annotations:3.2
>> =20
>> test-project>mvn -e -X -o compile
>> [INFO] [phase-name] Maven lifecycle phase is validate
>> =20
>> i wonder if Mr Gosling could possibly shed some light on this ?
>> =20
>> Thanks Robert=2C
>> Martin-
>> =20
>> =20
>> =20
>>> Date: Mon=2C 30 Dec 2013 08:07:46 -0800
>>> From: HYPERLINK 
>>> "mailto:robert.patrick@oracle.com"robert.patrick@oracle=
> .com
>>> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
>>> Subject: RE: Plugin phase awareness...
>>> =20
>>> I had attached it to the last email but you can grab it here: 
>>> https://d=
> l.dropboxusercontent.com/u/78116035/maven/lifecycle-phase.zip=20
>>> =20
>>> Hope this helps=2C
>>> Robert
>>> =20
>>> --
>>> Robert Patrick <HYPERLINK 
>>> "mailto:robert.patrick@oracle.com"robert.patr=
> ick@oracle.com>
>>> VP=2C FMW Platform Architecture
>>> Oracle Corporation Office: +1.940.725.0011
>>> 1148 Triple Crown Court Fax: +1.940.725.0012 Bartonville=2C TX 
>>> 76226=2C USA Mobile: +1.469.556.9450
>>> =20
>>> Professional Oracle WebLogic Server
>>> by Robert Patrick=2C Gregory Nyberg=2C and Philip Aston with Josh 
>>> Bregman and Paul Done Book Home Page: http://www.wrox.com/ Kindle 
>>> Version: http://www.amazon.com/
>>> =20
>>> =20
>>> -----Original Message-----
>>> From: Martin Gainty [mailto:mgainty@hotmail.com]=20
>>> Sent: Monday=2C December 30=2C 2013 10:02 AM
>>> To: Maven Developers List
>>> Subject: RE: Plugin phase awareness...
>>> =20
>>> =20
>>> Good Morning Patrick
>>> =20
>>> could you upload plugin and test-harness somewhere (and let me have 
>>> acc=
> ess).. I would really like to get this working (and close out this 
> bug)
>>> =20
>>> Many Thanks for your help (and support)!
>>> Martin Gainty
>>> ______________________________________________=20
>>> =20
>>> Inte f=F6r=E4ndra och st=F6ra denna =F6verf=F6ring tack
>>> =20
>>> =20
>>> =20
>>> =20
>>> =20
>>> Date: Mon=2C 30 Dec 2013 07:46:49 -0800
>>> From: HYPERLINK 
>>> "mailto:robert.patrick@oracle.com"robert.patrick@oracle=
> .com
>>> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
>>> Subject: RE: Plugin phase awareness...
>>> =20
>>> Seems to work properly with Maven 3.0.5 anyway. See attached plugin 
>>> and=
> test project.
>>> =20
>>> =20
>>> --
>>> Robert Patrick <HYPERLINK 
>>> "mailto:robert.patrick@oracle.com"robert.patr=
> ick@oracle.com> VP=2C FMW Platform Architecture
>>> Oracle Corporation Office: +1.940.725.0011
>>> 1148 Triple Crown Court Fax: +1.940.725.0012 Bartonville=2C TX 
>>> 76226=2C USA Mobile: +1.469.556.9450
>>> =20
>>> Professional Oracle WebLogic Server
>>> by Robert Patrick=2C Gregory Nyberg=2C and Philip Aston with Josh 
>>> Bregm=
> an and Paul Done Book Home Page: http://www.wrox.com/ Kindle Version: 
> http:= //www.amazon.com/
>>> =20
>>> =20
>>> -----Original Message-----
>>> From: Martin Gainty [mailto:mgainty@hotmail.com]
>>> Sent: Sunday=2C December 29=2C 2013 7:25 PM
>>> To: Maven Developers List
>>> Subject: RE: Plugin phase awareness...
>>> =20
>>> =20
>>> =20
>>> =20
>>> =20
>>>> From: HYPERLINK "mailto:mgainty@hotmail.com"mgainty@hotmail.com
>>>> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
>>>> Subject: RE: Plugin phase awareness...
>>>> Date: Sun=2C 29 Dec 2013 17:46:29 -0500
>>>> =20
>>>> =20
>>>> =20
>>>> =20
>>>> =20
>>>> =20
>>>>> Date: Sun=2C 29 Dec 2013 15:13:12 +0000
>>>>> Subject: Re: Plugin phase awareness...
>>>>> From: HYPERLINK 
>>>>> "mailto:stephen.alan.connolly@gmail.com"stephen.ala=
> n.connolly@gmail.com
>>>>> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
>>>>> =20
>>>>> Are you running the mojo directly in your testing by any chance?
>>>>> =20
>>>>> Eg
>>>>> =20
>>>>> mvn short-name:goal
>>>> MG>Correct I was testing in this fashion
>>>> =20
>>>>> As opposed to
>>>>> =20
>>>>> mvn phase
>>>> MG>Thanks Stephen I will try this out
>>> MG_12_29_2013>
>>> /**
>>> * @parameter expression=3D"${mojoExecution}"
>>> */
>>> @Parameter(defaultValue =3D "${mojoExecution}") private 
>>> org.apache.mave=
> n.plugin.MojoExecution execution=3B //supposedly mojoExecution 
> injected her= e public org.apache.maven.plugin.MojoExecution 
> getExecution() { return exec= ution=3B } //accessor for execution
>>> /**
>>> * @parameter expression=3D"${mojoExecution.lifecyclePhase}"
>>> */
>>> @Parameter(defaultValue =3D "${mojoExecution.lifecyclePhase}")
>>> private String lifecyclePhase=3B //supposedly lifecyclePhase is 
>>> injecte=
> d here
>>> public org.apache.maven.model.Plugin plugin=3Dnew 
>>> org.apache.maven.mode=
> l.Plugin()=3B
>>> public String getLifecyclePhase() { //accessor for lifecyclePhase
>>> if(lifecyclePhase=3D=3Dnull) {
>>> plugin.setGroupId("org.apache.maven.plugins")=3B
>>> plugin.setArtifactId("maven-compiler-plugin")=3B
>>> plugin.setVersion("3.1")=3B
>>> String goal=3D"compile"=3B
>>> String executionId=3D"executionId"=3B 
>>> System.out.println("CompilerMojoTestCase::getLifecyclePhase 
>>> goal=3D"+go=
> al+" executionId=3D"+executionId)=3B
>>> org.apache.maven.plugin.MojoExecution mojo=3Dnew 
>>> org.apache.maven.plugi=
> n.MojoExecution((org.apache.maven.model.Plugin)plugin=2C goal=2C 
> executionI= d )=3B
>>> lifecyclePhase=3D mojo.getLifecyclePhase()=3B } return 
>>> lifecyclePhase=3B }
>>> =20
>>> MG_12_29_2013>public void testCompilerBasic() throws Exception { 
>>> System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 
>>> ge=
> tLifeyclePhase()=3D "+getLifecyclePhase())=3B
>>> =20
>>> MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst 
>>> MG_12_29_=
> 2013>CompilerMojoTestCase::getLifecyclePhase goal=3Dcompile 
> 2013>executionId=3De=
> xecutionId
>>> MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 
>>> getLifey=
> clePhase()=3D null


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


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


Re: Plugin phase awareness...

Posted by Stuart McCulloch <mc...@gmail.com>.
On 31 Dec 2013, at 12:51, Martin Gainty <mg...@hotmail.com> wrote:

> --_d7af7d72-ddaf-4bb4-8989-06a73d80616e_
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> [DEBUG] test:lifecycle-phases-plugin:jar:1.0:
> [DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-model:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-artifact:jar:3.0:compile
> [DEBUG]       org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
> [DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
> [DEBUG]             org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
> [DEBUG]    org.apache.maven:maven-core:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-settings:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-settings-builder:jar:3.0:compile
> [DEBUG]          org.codehaus.mojo:animal-sniffer:jar:1.6:compile
> [DEBUG]             asm:asm-all:jar:3.1:compile
> [DEBUG]          org.codehaus.plexus:plexus-component-metadata:jar:1.5.4:co=
> mpile
> [DEBUG]             org.codehaus.plexus:plexus-container-default:jar:1.5.4:=
> compile
> [DEBUG]                org.apache.xbean:xbean-reflect:jar:3.4:compile
> [DEBUG]                   log4j:log4j:jar:1.2.12:compile
> [DEBUG]                   commons-logging:commons-logging-api:jar:1.1:compi=
> le
> [DEBUG]                com.google.collections:google-collections:jar:1.0:co=
> mpile
> [DEBUG]                junit:junit:jar:3.8.2:compile
> [DEBUG]             com.thoughtworks.qdox:qdox:jar:1.9.2:compile
> [DEBUG]             jdom:jdom:jar:1.0:compile
> [DEBUG]             org.apache.maven:maven-project:jar:2.0.9:compile
> [DEBUG]                org.apache.maven.plugin-tools:maven-plugin-tools-api=
> :jar:3.0:compile
> [DEBUG]                   org.apache.maven:maven-plugin-descriptor:jar:2.2.=
> 1:compile
> [DEBUG]                org.apache.maven:maven-profile:jar:2.0.9:compile
> [DEBUG]                org.apache.maven:maven-artifact-manager:jar:2.0.9:co=
> mpile
> [DEBUG]                org.apache.maven:maven-plugin-registry:jar:2.0.9:com=
> pile
> [DEBUG]             org.codehaus.plexus:plexus-cli:jar:1.2:compile
> [DEBUG]             commons-cli:commons-cli:jar:1.0:compile
> [DEBUG]                commons-logging:commons-logging:jar:1.0:compile
> [DEBUG]                commons-lang:commons-lang:jar:1.0:compile
> [DEBUG]             asm:asm:jar:3.1:compile
> [DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-model-builder:jar:3.0:compile
> [DEBUG]       org.apache.maven:maven-aether-provider:jar:3.0:runtime
> [DEBUG]       org.sonatype.aether:aether-impl:jar:1.7:compile
> [DEBUG]          org.apache.maven.plugins:maven-surefire-plugin:jar:2.4.2:c=
> ompile
> [DEBUG]             org.apache.maven.surefire:surefire-booter:jar:2.4.2:com=
> pile
> [DEBUG]                org.apache.maven.surefire:maven-surefire-common:jar:=
> 2.12.4:compile
> [DEBUG]                   org.apache.maven.plugin-tools:maven-plugin-annota=
> tions:jar:3.1:compile
> [DEBUG]                   org.apache.maven:maven-toolchain:jar:2.0.9:compil=
> e
> [DEBUG]                   org.apache.commons:commons-lang3:jar:3.1:compile
> [DEBUG]                   org.apache.maven.shared:maven-common-artifact-fil=
> ters:jar:1.3:compile
> [DEBUG]                org.apache.maven.surefire:surefire-api:jar:2.4.2:com=
> pile
> [DEBUG]             org.apache.maven.surefire:surefire-junit:jar:2.4.2:comp=
> ile
> [DEBUG]          org.sonatype.aether:aether-spi:jar:1.7:compile
> [DEBUG]       org.sonatype.aether:aether-api:jar:1.7:compile
> [DEBUG]       org.sonatype.aether:aether-util:jar:1.7:compile
> [DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
> [DEBUG]       org.codehaus.plexus:plexus-utils:jar:2.0.4:compile
> [DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
> [DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:co=
> mpile
> [DEBUG]       org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
> [DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
> [DEBUG] Created new class realm maven.api
> [DEBUG] Importing foreign packages into class realm maven.api
> [DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.transfer < plexus.core
> [DEBUG]   Imported: org.apache.maven.exception < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.metadata < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.collection < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.version < plexus.core
> [DEBUG]   Imported: org.apache.maven.monitor < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
> [DEBUG]   Imported: org.apache.maven.repository < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
> [DEBUG]   Imported: org.apache.maven.profiles < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.repository < plexus.core
> [DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
> [DEBUG]   Imported: org.apache.maven.execution < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.artifact < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.spi < plexus.core
> [DEBUG]   Imported: org.apache.maven.reporting < plexus.core
> [DEBUG]   Imported: org.apache.maven.usability < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexu=
> s.core
> [DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
> [DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.graph < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.settings < plexus.core
> [DEBUG]   Imported: org.codehaus.classworlds < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.impl < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.deployment < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserExceptio=
> n < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexu=
> s.core
> [DEBUG]   Imported: org.apache.maven.configuration < plexus.core
> [DEBUG]   Imported: org.apache.maven.cli < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.installation < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
> [DEBUG]   Imported: org.apache.maven.project < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
> [DEBUG]   Imported: org.apache.maven.artifact < plexus.core
> [DEBUG]   Imported: org.apache.maven.model < plexus.core
> [DEBUG]   Imported: org.apache.maven.* < plexus.core
> [DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
> [DEBUG]   Imported: org.sonatype.aether.resolution < plexus.core
> [DEBUG]   Imported: org.apache.maven.plugin < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
> [DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
> [DEBUG] Populating class realm maven.api
> [DEBUG] Created new class realm plugin>test:lifecycle-phases-plugin:1.0
> [DEBUG] Importing foreign packages into class realm plugin>test:lifecycle-p=
> hases-plugin:1.0
> [DEBUG]   Imported:  < maven.api
> [DEBUG] Populating class realm plugin>test:lifecycle-phases-plugin:1.0
> [DEBUG]   Included: test:lifecycle-phases-plugin:jar:1.0
> [DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
> [DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
> [DEBUG]   Included: org.codehaus.mojo:animal-sniffer:jar:1.6
> [DEBUG]   Included: asm:asm-all:jar:3.1
> [DEBUG]   Included: org.codehaus.plexus:plexus-component-metadata:jar:1.5.4
> [DEBUG]   Included: org.apache.xbean:xbean-reflect:jar:3.4
> [DEBUG]   Included: log4j:log4j:jar:1.2.12
> [DEBUG]   Included: commons-logging:commons-logging-api:jar:1.1
> [DEBUG]   Included: com.google.collections:google-collections:jar:1.0
> [DEBUG]   Included: junit:junit:jar:3.8.2
> [DEBUG]   Included: com.thoughtworks.qdox:qdox:jar:1.9.2
> [DEBUG]   Included: jdom:jdom:jar:1.0
> [DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-tools-api:ja=
> r:3.0
> [DEBUG]   Included: org.codehaus.plexus:plexus-cli:jar:1.2
> [DEBUG]   Included: commons-cli:commons-cli:jar:1.0
> [DEBUG]   Included: commons-logging:commons-logging:jar:1.0
> [DEBUG]   Included: commons-lang:commons-lang:jar:1.0
> [DEBUG]   Included: asm:asm:jar:3.1
> [DEBUG]   Included: org.apache.maven.plugins:maven-surefire-plugin:jar:2.4.=
> 2
> [DEBUG]   Included: org.apache.maven.surefire:surefire-booter:jar:2.4.2
> [DEBUG]   Included: org.apache.maven.surefire:maven-surefire-common:jar:2.1=
> 2.4
> [DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-annotations:=
> jar:3.1
> [DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.1
> [DEBUG]   Included: org.apache.maven.shared:maven-common-artifact-filters:j=
> ar:1.3
> [DEBUG]   Included: org.apache.maven.surefire:surefire-api:jar:2.4.2
> [DEBUG]   Included: org.apache.maven.surefire:surefire-junit:jar:2.4.2
> [DEBUG]   Included: org.sonatype.aether:aether-util:jar:1.7
> [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.4
> [DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.=
> 5.5
> [DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
> [DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-model:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:3.0
> [DEBUG]   Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2
> [DEBUG]   Excluded: org.apache.maven:maven-core:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-settings:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-settings-builder:jar:3.0
> [DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.5.4
> [DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.9
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.2.1
> [DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.9
> [DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
> [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-model-builder:jar:3.0
> [DEBUG]   Excluded: org.apache.maven:maven-aether-provider:jar:3.0
> [DEBUG]   Excluded: org.sonatype.aether:aether-impl:jar:1.7
> [DEBUG]   Excluded: org.apache.maven:maven-toolchain:jar:2.0.9
> [DEBUG]   Excluded: org.sonatype.aether:aether-spi:jar:1.7
> [DEBUG]   Excluded: org.sonatype.aether:aether-api:jar:1.7
> [DEBUG]   Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.2.3
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p=
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s=
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with=
> basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: validate-phase}
> [DEBUG]   (f) phase =3D validate
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is validate
> 
> MG>(correct)
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (compile-phase) @ lifecyc=
> le-phase-plugin-test ---
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p=
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s=
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with=
> basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: compile-phase}
> [DEBUG]   (f) phase =3D compile
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is compile
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (process-classes-phase) @=
> lifecycle-phase-plugin-test ---
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p=
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s=
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with=
> basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: process-classes-phase}
> [DEBUG]   (f) phase =3D process-classes
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is process-classes
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (package-phase) @ lifecyc=
> le-phase-plugin-test ---
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p=
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s=
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with=
> basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: package-phase}
> [DEBUG]   (f) phase =3D package
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is package
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (pre-integration-test-pha=
> se) @ lifecycle-phase-plugin-test ---
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p=
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s=
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with=
> basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: pre-integration-test-phase}
> [DEBUG]   (f) phase =3D pre-integration-test
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is pre-integration-test
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (post-integration-test-ph=
> ase) @ lifecycle-phase-plugin-test ---
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p=
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s=
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with=
> basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: post-integration-test-phase}
> [DEBUG]   (f) phase =3D post-integration-test
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is post-integration-test
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (verify-phase) @ lifecycl=
> e-phase-plugin-test ---
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p=
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s=
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with=
> basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: verify-phase}
> [DEBUG]   (f) phase =3D verify
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is verify
> MG>(correct)
> 
> 
> [INFO]=20
> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ lifecycle=
> -phase-plugin-test ---
> [DEBUG] org.apache.maven.plugins:maven-install-plugin:jar:2.3.1:
> [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
> [DEBUG]    org.apache.maven:maven-project:jar:2.0.6:compile
> [DEBUG]       org.apache.maven:maven-settings:jar:2.0.6:compile
> [DEBUG]       org.apache.maven:maven-profile:jar:2.0.6:compile
> [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
> [DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.5.5:compil=
> e
> [DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:2.3.3:compile
> [DEBUG]             org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.3:compile
> [DEBUG]                com.google.guava:guava:jar:13.0.1:compile
> [DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.2.2:compile
> [DEBUG]          org.apache.xbean:xbean-reflect:jar:3.4:compile
> [DEBUG]             log4j:log4j:jar:1.2.12:compile
> [DEBUG]             commons-logging:commons-logging-api:jar:1.1:compile
> [DEBUG]          com.google.collections:google-collections:jar:1.0:compile
> [DEBUG]          junit:junit:jar:4.11:compile
> [DEBUG]             org.hamcrest:hamcrest-core:jar:1.3:compile
> [DEBUG]    org.apache.maven:maven-model:jar:2.0.6:compile
> [DEBUG]    org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
> [DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
> [DEBUG]    org.apache.maven:maven-artifact:jar:2.0.6:compile
> [DEBUG]    org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
> [DEBUG]    org.codehaus.plexus:plexus-digest:jar:1.0:compile
> [DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-insta=
> ll-plugin:2.3.1
> [DEBUG] Importing foreign packages into class realm plugin>org.apache.maven=
> .plugins:maven-install-plugin:2.3.1
> [DEBUG]   Imported:  < maven.api
> [DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-instal=
> l-plugin:2.3.1
> [DEBUG]   Included: org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
> [DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.3
> [DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.3
> [DEBUG]   Included: com.google.guava:guava:jar:13.0.1
> [DEBUG]   Included: org.apache.xbean:xbean-reflect:jar:3.4
> [DEBUG]   Included: log4j:log4j:jar:1.2.12
> [DEBUG]   Included: commons-logging:commons-logging-api:jar:1.1
> [DEBUG]   Included: com.google.collections:google-collections:jar:1.0
> [DEBUG]   Included: junit:junit:jar:4.11
> [DEBUG]   Included: org.hamcrest:hamcrest-core:jar:1.3
> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
> [DEBUG]   Included: org.codehaus.plexus:plexus-digest:jar:1.0
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.6
> [DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.5.5
> [DEBUG]   Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.2.2
> [DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.6
> [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.6
> [DEBUG] Configuring mojo org.apache.maven.plugins:maven-install-plugin:2.3.=
> 1:install from plugin realm ClassRealm[plugin>org.apache.maven.plugins:mave=
> n-install-plugin:2.3.1=2C parent: sun.misc.Launcher$AppClassLoader@68ffab0a=
> ]
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-install-plugin:2.3=
> .1:install' with basic configurator -->
> [DEBUG]   (f) artifact =3D test:lifecycle-phase-plugin-test:pom:1.0-SNAPSHO=
> T
> [DEBUG]   (f) attachedArtifacts =3D []
> [DEBUG]   (f) createChecksum =3D false
> [DEBUG]   (f) localRepository =3D        id: local
>      url: file:///C:/Users/mgainty/.m2/repository/
>   layout: none
> 
> [DEBUG]   (f) packaging =3D pom
> [DEBUG]   (f) pomFile =3D C:\Maven-plugin\lifecycle-phase\test-project\pom.=
> xml
> [DEBUG]   (f) updateReleaseInfo =3D false
> [DEBUG] -- end configuration --
> [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C=
> :\Users\mgainty\.m2\repository
> [INFO] Installing C:\Maven-plugin\lifecycle-phase\test-project\pom.xml to C=
> :\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-test\1.0-SNAPSHO=
> T\lifecycle-phase-plugin-test-1.0-SNAPSHOT.pom
> [DEBUG] Installing test:lifecycle-phase-plugin-test:1.0-SNAPSHOT/maven-meta=
> data.xml to C:\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-tes=
> t\1.0-SNAPSHOT\maven-metadata-local.xml
> [DEBUG] Installing test:lifecycle-phase-plugin-test/maven-metadata.xml to C=
> :\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-test\maven-metad=
> ata-local.xml
> [INFO]=20
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (install-phase) @ lifecyc=
> le-phase-plugin-test ---
> [DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from p=
> lugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0=2C parent: s=
> un.misc.Launcher$AppClassLoader@68ffab0a]
> [DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with=
> basic configurator -->
> [DEBUG]   (f) execution =3D test:lifecycle-phases-plugin:1.0:phase-name {ex=
> ecution: install-phase}
> [DEBUG]   (f) phase =3D install
> [DEBUG] -- end configuration --
> [INFO] [phase-name] Maven lifecycle phase is install
> MG>(correct)
> 
> so compiling and running with JDK/JVM/JRE 1.7.0_45 does correct the bug
> I will update JIRA that this only fails with 1.7.0_25 JDK/JVM/JRE (and does=
> not fail with JDK/JVM/JRE 1.7.0_45)

Patrick’s test project works for me with JDK 1.7.0_25 (on OS X) … can you post the failing log? (ie. same as above, but for the failing case)

> https://jira.codehaus.org/browse/MNG-5555
> 
> =20
> 
> I am puzzled why this bug is manifested when compiling and executing with 1=
> .7.0_25=20
> I would appreciate hearing about bug-fixes from the JVM team that were corr=
> ected in 1.7.0_25 (in the 1.7.0_45 release)
> 
> =20
> 
> Much appreciated Mr Patrick!
> Happy New Year
> 
> Martin Gainty=20
> ______________________________________________=20
> Porfavor..no altere ni interrumpir esta communicacion..Gracias
> Please ..do not alter or interrupt this communicaction..Thank You
> 
> =20
> 
> 
> 
>> Date: Mon=2C 30 Dec 2013 15:02:05 -0800
>> From: robert.patrick@oracle.com
>> To: mgainty@hotmail.com=3B dev@maven.apache.org
>> Subject: RE: Plugin phase awareness...
>> =20
>> I don't have Maven 3.02 or Java 7u25 handy but as you can see from my exa=
> mple execution below=2C Maven 3.0.5 and Java 7u45 works fine-that is=2C mul=
> tiple executions of the plugin in the different lifecycle phases that I hav=
> e executions declared in my project POM for all return the same value as th=
> e lifecycle phase).
>> =20
>> =20
>> =20
>> C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn  -version
>> =20
>> Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da=3B 2013-02-=
> 19 07:51:
>> =20
>> 28-0600)
>> =20
>> Maven home: c:\wls1213\oracle_common\modules\org.apache.maven_3.0.5
>> =20
>> Java version: 1.7.0_45=2C vendor: Oracle Corporation
>> =20
>> Java home: c:\java\jdk1.7.0\jre
>> =20
>> Default locale: en_US=2C platform encoding: Cp1252
>> =20
>> OS name: "windows 7"=2C version: "6.1"=2C arch: "amd64"=2C family: "windo=
> ws"
>> =20
>> =20
>> =20
>> C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn install
>> =20
>> [INFO] Scanning for projects...
>> =20
>> [INFO]
>> =20
>> [INFO] ------------------------------------------------------------------=
> ------
>> =20
>> [INFO] Building lifecycle-phase-plugin-test 1.0-SNAPSHOT
>> =20
>> [INFO] ------------------------------------------------------------------=
> ------
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (validate-phase) @ life=
> cycle-p
>> =20
>> hase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is validate
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (compile-phase) @ lifec=
> ycle-ph
>> =20
>> ase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is compile
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (process-classes-phase)=
> @ life
>> =20
>> cycle-phase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is process-classes
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (package-phase) @ lifec=
> ycle-ph
>> =20
>> ase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is package
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (pre-integration-test-p=
> hase) @
>> =20
>> lifecycle-phase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is pre-integration-test
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (post-integration-test-=
> phase)
>> =20
>> @ lifecycle-phase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is post-integration-test
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (verify-phase) @ lifecy=
> cle-pha
>> =20
>> se-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is verify
>> =20
>> [INFO]
>> =20
>> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ lifecyc=
> le-phas
>> =20
>> e-plugin-test ---
>> =20
>> [INFO] Installing C:\rpatrick\work\src\maven\lifecycle-phase\test-project=
> \pom.xm
>> =20
>> l to C:\Users\rpatrick\.m2\repository\test\lifecycle-phase-plugin-test\1.=
> 0-SNAPS
>> =20
>> HOT\lifecycle-phase-plugin-test-1.0-SNAPSHOT.pom
>> =20
>> [INFO]
>> =20
>> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (install-phase) @ lifec=
> ycle-ph
>> =20
>> ase-plugin-test ---
>> =20
>> [INFO] [phase-name] Maven lifecycle phase is install
>> =20
>> [INFO] ------------------------------------------------------------------=
> ------
>> =20
>> [INFO] BUILD SUCCESS
>> =20
>> [INFO] ------------------------------------------------------------------=
> ------
>> =20
>> [INFO] Total time: 0.880s
>> =20
>> [INFO] Finished at: Mon Dec 30 16:55:29 CST 2013
>> =20
>> [INFO] Final Memory: 14M/490M
>> =20
>> [INFO] ------------------------------------------------------------------=
> ------
>> =20
>> =20
>> =20
>> =20
>> =20
>> =20
>> =20
>> --
>> =20
>> Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patric=
> k@oracle.com>
>> =20
>> VP=2C FMW Platform Architecture
>> =20
>> Oracle Corporation                                Office: +1.940.725.0011
>> =20
>> 1148 Triple Crown Court                                 Fax: +1.940.725.0=
> 012
>> =20
>> Bartonville=2C TX 76226=2C USA                    Mobile: +1.469.556.9450
>> =20
>> =20
>> =20
>> HYPERLINK "http://www.amazon.com/Professional-Oracle-WebLogic-Server-Patr=
> ick/dp/0470484306/"Professional Oracle WebLogic Server
>> =20
>> by Robert Patrick=2C Gregory Nyberg=2C and Philip Aston
>> =20
>> with Josh Bregman and Paul Done
>> =20
>> Book Home Page: HYPERLINK "http://www.wrox.com/WileyCDA/WroxTitle/Profess=
> ional-Oracle-WebLogic-Server.productCd-0470484306.html"http://www.wrox.com/
>> =20
>> Kindle Version: HYPERLINK "http://www.amazon.com/Professional-Oracle-WebL=
> ogic-Server-ebook/dp/B004HD69J2/"http://www.amazon.com/
>> =20
>> =20
>> =20
>> =20
>> =20
>> From: Martin Gainty [mailto:mgainty@hotmail.com]=20
>> Sent: Monday=2C December 30=2C 2013 3:41 PM
>> To: Maven Developers List=3B Robert Patrick
>> Subject: RE: Plugin phase awareness...
>> =20
>> =20
>> =20
>> operational with JDK-1.6 but compiling and running with Oracle Java versi=
> on=3D1.7.0.25 reproduces the bug
>> =20
>> JDK: 1.6
>> mvn -version=3D3.0.2
>> maven-core:3.0
>> maven-plugin-annotations:3.2
>> test-project>mvn -e -X -o compile
>> [INFO] [phase-name]  Maven lifecycle phase is compile (correct)
>> =20
>> JDK: 1.6
>> mvn -version =3D3.0.5
>> maven-core:3.0
>> maven-plugin-annotations:3.2
>> test-project>mvn -e -X -o compile
>> [INFO] [phase-name] Maven lifecycle phase is compile (correct)
>> =20
>> JDK: 1.6
>> mvn -version=3D3.1.1
>> maven-core:3.0
>> maven-plugin-annotations:3.2
>> test-project>mvn -e -X -o compile
>> [INFO] [phase-name] Maven lifecycle phase is compile (correct)
>> =20
>> ----------------------------------JDK-1.7.0.25---------------------------=
> ---
>> BASH>mvn -version
>> Apache Maven 3.0.2 (r1056850=3B 2011-01-08 19:58:10-0500)
>> Java version: 1.7.0_25=2C vendor: Oracle Corporation
>> Java home: jdk1.7.0_25/jre
>> Default locale: en_US=2C platform encoding: Cp1252
>> OS name: "windows 7"=2C version: "6.1"=2C arch: "amd64"=2C family: "windo=
> ws"
>> =20
>> mvn -version=3D3.0.2
>> maven-core:3.0
>> maven-plugin-annotations:3.2
>> =20
>> test-project>mvn -e -X -o compile
>> [INFO] [phase-name] Maven lifecycle phase is validate
>> =20
>> i wonder if Mr Gosling could possibly shed some light on this ?
>> =20
>> Thanks Robert=2C
>> Martin-
>> =20
>> =20
>> =20
>>> Date: Mon=2C 30 Dec 2013 08:07:46 -0800
>>> From: HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle=
> .com
>>> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
>>> Subject: RE: Plugin phase awareness...
>>> =20
>>> I had attached it to the last email but you can grab it here: https://d=
> l.dropboxusercontent.com/u/78116035/maven/lifecycle-phase.zip=20
>>> =20
>>> Hope this helps=2C
>>> Robert
>>> =20
>>> --
>>> Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patr=
> ick@oracle.com>
>>> VP=2C FMW Platform Architecture
>>> Oracle Corporation Office: +1.940.725.0011
>>> 1148 Triple Crown Court Fax: +1.940.725.0012
>>> Bartonville=2C TX 76226=2C USA Mobile: +1.469.556.9450
>>> =20
>>> Professional Oracle WebLogic Server
>>> by Robert Patrick=2C Gregory Nyberg=2C and Philip Aston
>>> with Josh Bregman and Paul Done
>>> Book Home Page: http://www.wrox.com/
>>> Kindle Version: http://www.amazon.com/
>>> =20
>>> =20
>>> -----Original Message-----
>>> From: Martin Gainty [mailto:mgainty@hotmail.com]=20
>>> Sent: Monday=2C December 30=2C 2013 10:02 AM
>>> To: Maven Developers List
>>> Subject: RE: Plugin phase awareness...
>>> =20
>>> =20
>>> Good Morning Patrick
>>> =20
>>> could you upload plugin and test-harness somewhere (and let me have acc=
> ess).. I would really like to get this working (and close out this bug)
>>> =20
>>> Many Thanks for your help (and support)!
>>> Martin Gainty
>>> ______________________________________________=20
>>> =20
>>> Inte f=F6r=E4ndra och st=F6ra denna =F6verf=F6ring tack
>>> =20
>>> =20
>>> =20
>>> =20
>>> =20
>>> Date: Mon=2C 30 Dec 2013 07:46:49 -0800
>>> From: HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle=
> .com
>>> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
>>> Subject: RE: Plugin phase awareness...
>>> =20
>>> Seems to work properly with Maven 3.0.5 anyway. See attached plugin and=
> test project.
>>> =20
>>> =20
>>> --
>>> Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patr=
> ick@oracle.com> VP=2C FMW Platform Architecture
>>> Oracle Corporation Office: +1.940.725.0011
>>> 1148 Triple Crown Court Fax: +1.940.725.0012
>>> Bartonville=2C TX 76226=2C USA Mobile: +1.469.556.9450
>>> =20
>>> Professional Oracle WebLogic Server
>>> by Robert Patrick=2C Gregory Nyberg=2C and Philip Aston with Josh Bregm=
> an and Paul Done Book Home Page: http://www.wrox.com/ Kindle Version: http:=
> //www.amazon.com/
>>> =20
>>> =20
>>> -----Original Message-----
>>> From: Martin Gainty [mailto:mgainty@hotmail.com]
>>> Sent: Sunday=2C December 29=2C 2013 7:25 PM
>>> To: Maven Developers List
>>> Subject: RE: Plugin phase awareness...
>>> =20
>>> =20
>>> =20
>>> =20
>>> =20
>>>> From: HYPERLINK "mailto:mgainty@hotmail.com"mgainty@hotmail.com
>>>> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
>>>> Subject: RE: Plugin phase awareness...
>>>> Date: Sun=2C 29 Dec 2013 17:46:29 -0500
>>>> =20
>>>> =20
>>>> =20
>>>> =20
>>>> =20
>>>> =20
>>>>> Date: Sun=2C 29 Dec 2013 15:13:12 +0000
>>>>> Subject: Re: Plugin phase awareness...
>>>>> From: HYPERLINK "mailto:stephen.alan.connolly@gmail.com"stephen.ala=
> n.connolly@gmail.com
>>>>> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
>>>>> =20
>>>>> Are you running the mojo directly in your testing by any chance?
>>>>> =20
>>>>> Eg
>>>>> =20
>>>>> mvn short-name:goal
>>>> MG>Correct I was testing in this fashion
>>>> =20
>>>>> As opposed to
>>>>> =20
>>>>> mvn phase
>>>> MG>Thanks Stephen I will try this out
>>> MG_12_29_2013>
>>> /**
>>> * @parameter expression=3D"${mojoExecution}"
>>> */
>>> @Parameter(defaultValue =3D "${mojoExecution}") private org.apache.mave=
> n.plugin.MojoExecution execution=3B //supposedly mojoExecution injected her=
> e public org.apache.maven.plugin.MojoExecution getExecution() { return exec=
> ution=3B } //accessor for execution
>>> /**
>>> * @parameter expression=3D"${mojoExecution.lifecyclePhase}"
>>> */
>>> @Parameter(defaultValue =3D "${mojoExecution.lifecyclePhase}")
>>> private String lifecyclePhase=3B //supposedly lifecyclePhase is injecte=
> d here
>>> public org.apache.maven.model.Plugin plugin=3Dnew org.apache.maven.mode=
> l.Plugin()=3B
>>> public String getLifecyclePhase() { //accessor for lifecyclePhase
>>> if(lifecyclePhase=3D=3Dnull) {
>>> plugin.setGroupId("org.apache.maven.plugins")=3B
>>> plugin.setArtifactId("maven-compiler-plugin")=3B
>>> plugin.setVersion("3.1")=3B
>>> String goal=3D"compile"=3B
>>> String executionId=3D"executionId"=3B
>>> System.out.println("CompilerMojoTestCase::getLifecyclePhase goal=3D"+go=
> al+" executionId=3D"+executionId)=3B
>>> org.apache.maven.plugin.MojoExecution mojo=3Dnew org.apache.maven.plugi=
> n.MojoExecution((org.apache.maven.model.Plugin)plugin=2C goal=2C executionI=
> d )=3B
>>> lifecyclePhase=3D mojo.getLifecyclePhase()=3B
>>> }
>>> return lifecyclePhase=3B
>>> }
>>> =20
>>> MG_12_29_2013>public void testCompilerBasic() throws Exception {
>>> System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 ge=
> tLifeyclePhase()=3D "+getLifecyclePhase())=3B
>>> =20
>>> MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst MG_12_29_=
> 2013>CompilerMojoTestCase::getLifecyclePhase goal=3Dcompile executionId=3De=
> xecutionId
>>> MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 getLifey=
> clePhase()=3D null


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


RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
[DEBUG] test:lifecycle-phases-plugin:jar:1.0:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.0:compile
[DEBUG]       org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
[DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
[DEBUG]             org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
[DEBUG]    org.apache.maven:maven-core:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-settings-builder:jar:3.0:compile
[DEBUG]          org.codehaus.mojo:animal-sniffer:jar:1.6:compile
[DEBUG]             asm:asm-all:jar:3.1:compile
[DEBUG]          org.codehaus.plexus:plexus-component-metadata:jar:1.5.4:compile
[DEBUG]             org.codehaus.plexus:plexus-container-default:jar:1.5.4:compile
[DEBUG]                org.apache.xbean:xbean-reflect:jar:3.4:compile
[DEBUG]                   log4j:log4j:jar:1.2.12:compile
[DEBUG]                   commons-logging:commons-logging-api:jar:1.1:compile
[DEBUG]                com.google.collections:google-collections:jar:1.0:compile
[DEBUG]                junit:junit:jar:3.8.2:compile
[DEBUG]             com.thoughtworks.qdox:qdox:jar:1.9.2:compile
[DEBUG]             jdom:jdom:jar:1.0:compile
[DEBUG]             org.apache.maven:maven-project:jar:2.0.9:compile
[DEBUG]                org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:3.0:compile
[DEBUG]                   org.apache.maven:maven-plugin-descriptor:jar:2.2.1:compile
[DEBUG]                org.apache.maven:maven-profile:jar:2.0.9:compile
[DEBUG]                org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
[DEBUG]                org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
[DEBUG]             org.codehaus.plexus:plexus-cli:jar:1.2:compile
[DEBUG]             commons-cli:commons-cli:jar:1.0:compile
[DEBUG]                commons-logging:commons-logging:jar:1.0:compile
[DEBUG]                commons-lang:commons-lang:jar:1.0:compile
[DEBUG]             asm:asm:jar:3.1:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.0:compile
[DEBUG]       org.apache.maven:maven-aether-provider:jar:3.0:runtime
[DEBUG]       org.sonatype.aether:aether-impl:jar:1.7:compile
[DEBUG]          org.apache.maven.plugins:maven-surefire-plugin:jar:2.4.2:compile
[DEBUG]             org.apache.maven.surefire:surefire-booter:jar:2.4.2:compile
[DEBUG]                org.apache.maven.surefire:maven-surefire-common:jar:2.12.4:compile
[DEBUG]                   org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.1:compile
[DEBUG]                   org.apache.maven:maven-toolchain:jar:2.0.9:compile
[DEBUG]                   org.apache.commons:commons-lang3:jar:3.1:compile
[DEBUG]                   org.apache.maven.shared:maven-common-artifact-filters:jar:1.3:compile
[DEBUG]                org.apache.maven.surefire:surefire-api:jar:2.4.2:compile
[DEBUG]             org.apache.maven.surefire:surefire-junit:jar:2.4.2:compile
[DEBUG]          org.sonatype.aether:aether-spi:jar:1.7:compile
[DEBUG]       org.sonatype.aether:aether-api:jar:1.7:compile
[DEBUG]       org.sonatype.aether:aether-util:jar:1.7:compile
[DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:2.0.4:compile
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.2.3:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]       org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.sonatype.aether.transfer < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.sonatype.aether.metadata < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.sonatype.aether.collection < plexus.core
[DEBUG]   Imported: org.sonatype.aether.version < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.sonatype.aether.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.sonatype.aether.artifact < plexus.core
[DEBUG]   Imported: org.sonatype.aether.spi < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.sonatype.aether.graph < plexus.core
[DEBUG]   Imported: org.sonatype.aether.* < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.sonatype.aether.impl < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.sonatype.aether.deployment < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.sonatype.aether.installation < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.sonatype.aether.resolution < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Populating class realm maven.api
[DEBUG] Created new class realm plugin>test:lifecycle-phases-plugin:1.0
[DEBUG] Importing foreign packages into class realm plugin>test:lifecycle-phases-plugin:1.0
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>test:lifecycle-phases-plugin:1.0
[DEBUG]   Included: test:lifecycle-phases-plugin:jar:1.0
[DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:1.4.2
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7
[DEBUG]   Included: org.codehaus.mojo:animal-sniffer:jar:1.6
[DEBUG]   Included: asm:asm-all:jar:3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-component-metadata:jar:1.5.4
[DEBUG]   Included: org.apache.xbean:xbean-reflect:jar:3.4
[DEBUG]   Included: log4j:log4j:jar:1.2.12
[DEBUG]   Included: commons-logging:commons-logging-api:jar:1.1
[DEBUG]   Included: com.google.collections:google-collections:jar:1.0
[DEBUG]   Included: junit:junit:jar:3.8.2
[DEBUG]   Included: com.thoughtworks.qdox:qdox:jar:1.9.2
[DEBUG]   Included: jdom:jdom:jar:1.0
[DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:3.0
[DEBUG]   Included: org.codehaus.plexus:plexus-cli:jar:1.2
[DEBUG]   Included: commons-cli:commons-cli:jar:1.0
[DEBUG]   Included: commons-logging:commons-logging:jar:1.0
[DEBUG]   Included: commons-lang:commons-lang:jar:1.0
[DEBUG]   Included: asm:asm:jar:3.1
[DEBUG]   Included: org.apache.maven.plugins:maven-surefire-plugin:jar:2.4.2
[DEBUG]   Included: org.apache.maven.surefire:surefire-booter:jar:2.4.2
[DEBUG]   Included: org.apache.maven.surefire:maven-surefire-common:jar:2.12.4
[DEBUG]   Included: org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.1
[DEBUG]   Included: org.apache.commons:commons-lang3:jar:3.1
[DEBUG]   Included: org.apache.maven.shared:maven-common-artifact-filters:jar:1.3
[DEBUG]   Included: org.apache.maven.surefire:surefire-api:jar:2.4.2
[DEBUG]   Included: org.apache.maven.surefire:surefire-junit:jar:2.4.2
[DEBUG]   Included: org.sonatype.aether:aether-util:jar:1.7
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.4
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:3.0
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:3.0
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:3.0
[DEBUG]   Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2
[DEBUG]   Excluded: org.apache.maven:maven-core:jar:3.0
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:3.0
[DEBUG]   Excluded: org.apache.maven:maven-settings-builder:jar:3.0
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.5.4
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:3.0
[DEBUG]   Excluded: org.apache.maven:maven-model-builder:jar:3.0
[DEBUG]   Excluded: org.apache.maven:maven-aether-provider:jar:3.0
[DEBUG]   Excluded: org.sonatype.aether:aether-impl:jar:1.7
[DEBUG]   Excluded: org.apache.maven:maven-toolchain:jar:2.0.9
[DEBUG]   Excluded: org.sonatype.aether:aether-spi:jar:1.7
[DEBUG]   Excluded: org.sonatype.aether:aether-api:jar:1.7
[DEBUG]   Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.2.3
[DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from plugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with basic configurator -->
[DEBUG]   (f) execution = test:lifecycle-phases-plugin:1.0:phase-name {execution: validate-phase}
[DEBUG]   (f) phase = validate
[DEBUG] -- end configuration --
[INFO] [phase-name] Maven lifecycle phase is validate

MG>(correct)

[INFO] 
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (compile-phase) @ lifecycle-phase-plugin-test ---
[DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from plugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with basic configurator -->
[DEBUG]   (f) execution = test:lifecycle-phases-plugin:1.0:phase-name {execution: compile-phase}
[DEBUG]   (f) phase = compile
[DEBUG] -- end configuration --
[INFO] [phase-name] Maven lifecycle phase is compile
MG>(correct)


[INFO] 
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (process-classes-phase) @ lifecycle-phase-plugin-test ---
[DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from plugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with basic configurator -->
[DEBUG]   (f) execution = test:lifecycle-phases-plugin:1.0:phase-name {execution: process-classes-phase}
[DEBUG]   (f) phase = process-classes
[DEBUG] -- end configuration --
[INFO] [phase-name] Maven lifecycle phase is process-classes
MG>(correct)


[INFO] 
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (package-phase) @ lifecycle-phase-plugin-test ---
[DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from plugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with basic configurator -->
[DEBUG]   (f) execution = test:lifecycle-phases-plugin:1.0:phase-name {execution: package-phase}
[DEBUG]   (f) phase = package
[DEBUG] -- end configuration --
[INFO] [phase-name] Maven lifecycle phase is package
MG>(correct)


[INFO] 
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (pre-integration-test-phase) @ lifecycle-phase-plugin-test ---
[DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from plugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with basic configurator -->
[DEBUG]   (f) execution = test:lifecycle-phases-plugin:1.0:phase-name {execution: pre-integration-test-phase}
[DEBUG]   (f) phase = pre-integration-test
[DEBUG] -- end configuration --
[INFO] [phase-name] Maven lifecycle phase is pre-integration-test
MG>(correct)


[INFO] 
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (post-integration-test-phase) @ lifecycle-phase-plugin-test ---
[DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from plugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with basic configurator -->
[DEBUG]   (f) execution = test:lifecycle-phases-plugin:1.0:phase-name {execution: post-integration-test-phase}
[DEBUG]   (f) phase = post-integration-test
[DEBUG] -- end configuration --
[INFO] [phase-name] Maven lifecycle phase is post-integration-test
MG>(correct)


[INFO] 
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (verify-phase) @ lifecycle-phase-plugin-test ---
[DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from plugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with basic configurator -->
[DEBUG]   (f) execution = test:lifecycle-phases-plugin:1.0:phase-name {execution: verify-phase}
[DEBUG]   (f) phase = verify
[DEBUG] -- end configuration --
[INFO] [phase-name] Maven lifecycle phase is verify
MG>(correct)


[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ lifecycle-phase-plugin-test ---
[DEBUG] org.apache.maven.plugins:maven-install-plugin:jar:2.3.1:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.5.5:compile
[DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:2.3.3:compile
[DEBUG]             org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.3:compile
[DEBUG]                com.google.guava:guava:jar:13.0.1:compile
[DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.2.2:compile
[DEBUG]          org.apache.xbean:xbean-reflect:jar:3.4:compile
[DEBUG]             log4j:log4j:jar:1.2.12:compile
[DEBUG]             commons-logging:commons-logging-api:jar:1.1:compile
[DEBUG]          com.google.collections:google-collections:jar:1.0:compile
[DEBUG]          junit:junit:jar:4.11:compile
[DEBUG]             org.hamcrest:hamcrest-core:jar:1.3:compile
[DEBUG]    org.apache.maven:maven-model:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:2.0.6:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
[DEBUG]    org.codehaus.plexus:plexus-digest:jar:1.0:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-install-plugin:2.3.1
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-install-plugin:2.3.1
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-install-plugin:2.3.1
[DEBUG]   Included: org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
[DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.3
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.3
[DEBUG]   Included: com.google.guava:guava:jar:13.0.1
[DEBUG]   Included: org.apache.xbean:xbean-reflect:jar:3.4
[DEBUG]   Included: log4j:log4j:jar:1.2.12
[DEBUG]   Included: commons-logging:commons-logging-api:jar:1.1
[DEBUG]   Included: com.google.collections:google-collections:jar:1.0
[DEBUG]   Included: junit:junit:jar:4.11
[DEBUG]   Included: org.hamcrest:hamcrest-core:jar:1.3
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
[DEBUG]   Included: org.codehaus.plexus:plexus-digest:jar:1.0
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.6
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.5.5
[DEBUG]   Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.2.2
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.6
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.6
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-install-plugin:2.3.1:install from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-install-plugin:2.3.1, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-install-plugin:2.3.1:install' with basic configurator -->
[DEBUG]   (f) artifact = test:lifecycle-phase-plugin-test:pom:1.0-SNAPSHOT
[DEBUG]   (f) attachedArtifacts = []
[DEBUG]   (f) createChecksum = false
[DEBUG]   (f) localRepository =        id: local
      url: file:///C:/Users/mgainty/.m2/repository/
   layout: none

[DEBUG]   (f) packaging = pom
[DEBUG]   (f) pomFile = C:\Maven-plugin\lifecycle-phase\test-project\pom.xml
[DEBUG]   (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Users\mgainty\.m2\repository
[INFO] Installing C:\Maven-plugin\lifecycle-phase\test-project\pom.xml to C:\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-test\1.0-SNAPSHOT\lifecycle-phase-plugin-test-1.0-SNAPSHOT.pom
[DEBUG] Installing test:lifecycle-phase-plugin-test:1.0-SNAPSHOT/maven-metadata.xml to C:\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-test\1.0-SNAPSHOT\maven-metadata-local.xml
[DEBUG] Installing test:lifecycle-phase-plugin-test/maven-metadata.xml to C:\Users\mgainty\.m2\repository\test\lifecycle-phase-plugin-test\maven-metadata-local.xml
[INFO] 
[INFO] --- lifecycle-phases-plugin:1.0:phase-name (install-phase) @ lifecycle-phase-plugin-test ---
[DEBUG] Configuring mojo test:lifecycle-phases-plugin:1.0:phase-name from plugin realm ClassRealm[plugin>test:lifecycle-phases-plugin:1.0, parent: sun.misc.Launcher$AppClassLoader@68ffab0a]
[DEBUG] Configuring mojo 'test:lifecycle-phases-plugin:1.0:phase-name' with basic configurator -->
[DEBUG]   (f) execution = test:lifecycle-phases-plugin:1.0:phase-name {execution: install-phase}
[DEBUG]   (f) phase = install
[DEBUG] -- end configuration --
[INFO] [phase-name] Maven lifecycle phase is install
MG>(correct)


so compiling and running with JDK/JVM/JRE 1.7.0_45 does correct the bug
I will update JIRA that this only fails with 1.7.0_25 JDK/JVM/JRE (and does not fail with JDK/JVM/JRE 1.7.0_45)

https://jira.codehaus.org/browse/MNG-5555

 

I am puzzled why this bug is manifested when compiling and executing with 1.7.0_25 
I would appreciate hearing about bug-fixes from the JVM team that were corrected in 1.7.0_25 (in the 1.7.0_45 release)

 

Much appreciated Mr Patrick!
Happy New Year

Martin Gainty 
______________________________________________ 
Porfavor..no altere ni interrumpir esta communicacion..Gracias
Please ..do not alter or interrupt this communicaction..Thank You

  



> Date: Mon, 30 Dec 2013 15:02:05 -0800
> From: robert.patrick@oracle.com
> To: mgainty@hotmail.com; dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> 
> I don't have Maven 3.02 or Java 7u25 handy but as you can see from my example execution below, Maven 3.0.5 and Java 7u45 works fine-that is, multiple executions of the plugin in the different lifecycle phases that I have executions declared in my project POM for all return the same value as the lifecycle phase).
> 
>  
> 
> C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn  -version
> 
> Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 07:51:
> 
> 28-0600)
> 
> Maven home: c:\wls1213\oracle_common\modules\org.apache.maven_3.0.5
> 
> Java version: 1.7.0_45, vendor: Oracle Corporation
> 
> Java home: c:\java\jdk1.7.0\jre
> 
> Default locale: en_US, platform encoding: Cp1252
> 
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> 
>  
> 
> C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn install
> 
> [INFO] Scanning for projects...
> 
> [INFO]
> 
> [INFO] ------------------------------------------------------------------------
> 
> [INFO] Building lifecycle-phase-plugin-test 1.0-SNAPSHOT
> 
> [INFO] ------------------------------------------------------------------------
> 
> [INFO]
> 
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (validate-phase) @ lifecycle-p
> 
> hase-plugin-test ---
> 
> [INFO] [phase-name] Maven lifecycle phase is validate
> 
> [INFO]
> 
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (compile-phase) @ lifecycle-ph
> 
> ase-plugin-test ---
> 
> [INFO] [phase-name] Maven lifecycle phase is compile
> 
> [INFO]
> 
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (process-classes-phase) @ life
> 
> cycle-phase-plugin-test ---
> 
> [INFO] [phase-name] Maven lifecycle phase is process-classes
> 
> [INFO]
> 
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (package-phase) @ lifecycle-ph
> 
> ase-plugin-test ---
> 
> [INFO] [phase-name] Maven lifecycle phase is package
> 
> [INFO]
> 
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (pre-integration-test-phase) @
> 
> lifecycle-phase-plugin-test ---
> 
> [INFO] [phase-name] Maven lifecycle phase is pre-integration-test
> 
> [INFO]
> 
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (post-integration-test-phase)
> 
> @ lifecycle-phase-plugin-test ---
> 
> [INFO] [phase-name] Maven lifecycle phase is post-integration-test
> 
> [INFO]
> 
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (verify-phase) @ lifecycle-pha
> 
> se-plugin-test ---
> 
> [INFO] [phase-name] Maven lifecycle phase is verify
> 
> [INFO]
> 
> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ lifecycle-phas
> 
> e-plugin-test ---
> 
> [INFO] Installing C:\rpatrick\work\src\maven\lifecycle-phase\test-project\pom.xm
> 
> l to C:\Users\rpatrick\.m2\repository\test\lifecycle-phase-plugin-test\1.0-SNAPS
> 
> HOT\lifecycle-phase-plugin-test-1.0-SNAPSHOT.pom
> 
> [INFO]
> 
> [INFO] --- lifecycle-phases-plugin:1.0:phase-name (install-phase) @ lifecycle-ph
> 
> ase-plugin-test ---
> 
> [INFO] [phase-name] Maven lifecycle phase is install
> 
> [INFO] ------------------------------------------------------------------------
> 
> [INFO] BUILD SUCCESS
> 
> [INFO] ------------------------------------------------------------------------
> 
> [INFO] Total time: 0.880s
> 
> [INFO] Finished at: Mon Dec 30 16:55:29 CST 2013
> 
> [INFO] Final Memory: 14M/490M
> 
> [INFO] ------------------------------------------------------------------------
> 
>  
> 
>  
> 
>  
> 
> --
> 
> Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com>
> 
> VP, FMW Platform Architecture
> 
> Oracle Corporation                                Office: +1.940.725.0011
> 
> 1148 Triple Crown Court                                 Fax: +1.940.725.0012
> 
> Bartonville, TX 76226, USA                    Mobile: +1.469.556.9450
> 
>  
> 
> HYPERLINK "http://www.amazon.com/Professional-Oracle-WebLogic-Server-Patrick/dp/0470484306/"Professional Oracle WebLogic Server
> 
> by Robert Patrick, Gregory Nyberg, and Philip Aston
> 
> with Josh Bregman and Paul Done
> 
> Book Home Page: HYPERLINK "http://www.wrox.com/WileyCDA/WroxTitle/Professional-Oracle-WebLogic-Server.productCd-0470484306.html"http://www.wrox.com/
> 
> Kindle Version: HYPERLINK "http://www.amazon.com/Professional-Oracle-WebLogic-Server-ebook/dp/B004HD69J2/"http://www.amazon.com/
> 
>  
> 
>  
> 
> From: Martin Gainty [mailto:mgainty@hotmail.com] 
> Sent: Monday, December 30, 2013 3:41 PM
> To: Maven Developers List; Robert Patrick
> Subject: RE: Plugin phase awareness...
> 
>  
> 
> operational with JDK-1.6 but compiling and running with Oracle Java version=1.7.0.25 reproduces the bug
> 
> JDK: 1.6
> mvn -version=3.0.2
> maven-core:3.0
> maven-plugin-annotations:3.2
> test-project>mvn -e -X -o compile
> [INFO] [phase-name]  Maven lifecycle phase is compile (correct)
> 
> JDK: 1.6
> mvn -version =3.0.5
> maven-core:3.0
> maven-plugin-annotations:3.2
> test-project>mvn -e -X -o compile
> [INFO] [phase-name] Maven lifecycle phase is compile (correct)
>  
> JDK: 1.6
> mvn -version=3.1.1
> maven-core:3.0
> maven-plugin-annotations:3.2
> test-project>mvn -e -X -o compile
> [INFO] [phase-name] Maven lifecycle phase is compile (correct)
>  
> ----------------------------------JDK-1.7.0.25------------------------------
> BASH>mvn -version
> Apache Maven 3.0.2 (r1056850; 2011-01-08 19:58:10-0500)
> Java version: 1.7.0_25, vendor: Oracle Corporation
> Java home: jdk1.7.0_25/jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> 
> mvn -version=3.0.2
> maven-core:3.0
> maven-plugin-annotations:3.2
>  
> test-project>mvn -e -X -o compile
> [INFO] [phase-name] Maven lifecycle phase is validate
>  
> i wonder if Mr Gosling could possibly shed some light on this ?
> 
> Thanks Robert,
> Martin-
> 
>   
> 
> > Date: Mon, 30 Dec 2013 08:07:46 -0800
> > From: HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com
> > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > Subject: RE: Plugin phase awareness...
> > 
> > I had attached it to the last email but you can grab it here: https://dl.dropboxusercontent.com/u/78116035/maven/lifecycle-phase.zip 
> > 
> > Hope this helps,
> > Robert
> > 
> > --
> > Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com>
> > VP, FMW Platform Architecture
> > Oracle Corporation Office: +1.940.725.0011
> > 1148 Triple Crown Court Fax: +1.940.725.0012
> > Bartonville, TX 76226, USA Mobile: +1.469.556.9450
> > 
> > Professional Oracle WebLogic Server
> > by Robert Patrick, Gregory Nyberg, and Philip Aston
> > with Josh Bregman and Paul Done
> > Book Home Page: http://www.wrox.com/
> > Kindle Version: http://www.amazon.com/
> > 
> > 
> > -----Original Message-----
> > From: Martin Gainty [mailto:mgainty@hotmail.com] 
> > Sent: Monday, December 30, 2013 10:02 AM
> > To: Maven Developers List
> > Subject: RE: Plugin phase awareness...
> > 
> > 
> > Good Morning Patrick
> > 
> > could you upload plugin and test-harness somewhere (and let me have access).. I would really like to get this working (and close out this bug)
> > 
> > Many Thanks for your help (and support)!
> > Martin Gainty
> > ______________________________________________ 
> > 
> > Inte förändra och störa denna överföring tack
> > 
> > 
> > 
> > 
> > 
> > Date: Mon, 30 Dec 2013 07:46:49 -0800
> > From: HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com
> > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > Subject: RE: Plugin phase awareness...
> > 
> > Seems to work properly with Maven 3.0.5 anyway. See attached plugin and test project.
> > 
> > 
> > --
> > Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com> VP, FMW Platform Architecture
> > Oracle Corporation Office: +1.940.725.0011
> > 1148 Triple Crown Court Fax: +1.940.725.0012
> > Bartonville, TX 76226, USA Mobile: +1.469.556.9450
> > 
> > Professional Oracle WebLogic Server
> > by Robert Patrick, Gregory Nyberg, and Philip Aston with Josh Bregman and Paul Done Book Home Page: http://www.wrox.com/ Kindle Version: http://www.amazon.com/
> > 
> > 
> > -----Original Message-----
> > From: Martin Gainty [mailto:mgainty@hotmail.com]
> > Sent: Sunday, December 29, 2013 7:25 PM
> > To: Maven Developers List
> > Subject: RE: Plugin phase awareness...
> > 
> > 
> > 
> > 
> > 
> > > From: HYPERLINK "mailto:mgainty@hotmail.com"mgainty@hotmail.com
> > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > > Subject: RE: Plugin phase awareness...
> > > Date: Sun, 29 Dec 2013 17:46:29 -0500
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > > Date: Sun, 29 Dec 2013 15:13:12 +0000
> > > > Subject: Re: Plugin phase awareness...
> > > > From: HYPERLINK "mailto:stephen.alan.connolly@gmail.com"stephen.alan.connolly@gmail.com
> > > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > > > 
> > > > Are you running the mojo directly in your testing by any chance?
> > > > 
> > > > Eg
> > > > 
> > > > mvn short-name:goal
> > > MG>Correct I was testing in this fashion
> > > 
> > > > As opposed to
> > > > 
> > > > mvn phase
> > > MG>Thanks Stephen I will try this out
> > MG_12_29_2013>
> > /**
> > * @parameter expression="${mojoExecution}"
> > */
> > @Parameter(defaultValue = "${mojoExecution}") private org.apache.maven.plugin.MojoExecution execution; //supposedly mojoExecution injected here public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } //accessor for execution
> > /**
> > * @parameter expression="${mojoExecution.lifecyclePhase}"
> > */
> > @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
> > private String lifecyclePhase; //supposedly lifecyclePhase is injected here
> > public org.apache.maven.model.Plugin plugin=new org.apache.maven.model.Plugin();
> > public String getLifecyclePhase() { //accessor for lifecyclePhase
> > 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;
> > }
> > 
> > MG_12_29_2013>public void testCompilerBasic() throws Exception {
> > System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()= "+getLifecyclePhase());
> > 
> > MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst MG_12_29_2013>CompilerMojoTestCase::getLifecyclePhase goal=compile executionId=executionId
> > MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()= null
> > 
> > MG_12_29_2013>My thinking is that lifecyclePhase is somehow not being injected..
> > MG_12_29_2013>Ideas?
> > > 
> > > > Because if the former, then the phase is null as the execution was 
> > > > not bound to a phase.
> > > > 
> > > > I have not used this specific property before, so cannot speak to 
> > > > whether it works when bound to a phase, but if your test plugin 
> > > > execution is not bound to a phase then you would not expect to see a 
> > > > non null value
> > > > 
> > > > On Sunday, 29 December 2013, Martin Gainty wrote:
> > > > 
> > > > > Morning All-
> > > > >
> > > > >
> > > > >
> > > > > Even after downloading maven-core 3.1.1 source and re-compiling to 
> > > > > new maven-core-3.1.1.jar distro and forcing maven-core-3.1.1 
> > > > > dependency into maven-surefire-plugin
> > > > >
> > > > >
> > > > > I could not get ${mojoExecution.lifecyclePhase} to display 
> > > > > anything other than null
> > > > >
> > > > >
> > > > > https://jira.codehaus.org/browse/MNG-5555
> > > > >
> > > > >
> > > > >
> > > > > Ideas?
> > > > >
> > > > > Martin --
> > > > > ______________________________________________
> > > > >
> > > > >
> > > > > Inte förändra och störa denna överföring
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > From: HYPERLINK "mailto:mgainty@hotmail.com"mgainty@hotmail.com <javascript:;>
> > > > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org <javascript:;>
> > > > > Subject: RE: Plugin phase awareness...
> > > > > Date: Wed, 25 Dec 2013 22:40:07 -0500
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Wasted an enormous amount of time chasing the exact location of 
> > > > > .git file.. i guess its a good thing it was Christmas
> > > > >
> > > > > Thanks Jason!
> > > > > Martin Gainty
> > > > > ______________________________________________
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > From: HYPERLINK "mailto:jpyeron@pdinc.us"jpyeron@pdinc.us
> > > > > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > > > > > Subject: RE: Plugin phase awareness...
> > > > > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Martin Gainty
> > > > > > > Sent: Wednesday, December 25, 2013 10:40
> > > > > > >
> > > > > > > bash>git clone
> > > > > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-co
> > > > > > > bash>re src
> > > > > > > Cloning into 'src'...
> > > > > > > fatal: repository
> > > > > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > > > > not found
> > > > > >
> > > > > > It is not like subversion, git clone 
> > > > > > https://github.com/apache/maven.git
> > > > > >
> > > > > > The git operation will have to happen from the root of the 
> > > > > > repository,
> > > > > and git
> > > > > > hub does not auto redirect git clones to the proper url from the 
> > > > > > repo
> > > > > browser
> > > > > > urls.
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > > > > From: HYPERLINK "mailto:igor@ifedorenko.com"igor@ifedorenko.com
> > > > > > > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > > > > > > > Subject: Re: Plugin phase awareness...
> > > > > > > >
> > > > > > > >
> > > > > > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/sr
> > > > > > > c/main/j
> > > > > > > > ava/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: HYPERLINK "mailto:mgainty@hotmail.com"mgainty@hotmail.com
> > > > > > > > >> To: HYPERLINK "mailto:dev@maven.apache.org"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}"
> > > > > > > > >> */
> > > > > > > > >> @Pa
> > > > 
> > > > 
> > > > 
> > > > --
> > > > Sent from my phone
> > > 
> > 
> > 
> > --------------------------------------------------------------------- To unsubscribe, e-mail: HYPERLINK "mailto:dev-unsubscribe@maven.apache.org"dev-unsubscribe@maven.apache.org For additional commands, e-mail: HYPERLINK "mailto:dev-help@maven.apache.org"dev-help@maven.apache.org 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: HYPERLINK "mailto:dev-unsubscribe@maven.apache.org"dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: HYPERLINK "mailto:dev-help@maven.apache.org"dev-help@maven.apache.org
> > 
 		 	   		  

RE: Plugin phase awareness...

Posted by Robert Patrick <ro...@oracle.com>.
I don't have Maven 3.02 or Java 7u25 handy but as you can see from my example execution below, Maven 3.0.5 and Java 7u45 works fine-that is, multiple executions of the plugin in the different lifecycle phases that I have executions declared in my project POM for all return the same value as the lifecycle phase).

 

C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn  -version

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 07:51:

28-0600)

Maven home: c:\wls1213\oracle_common\modules\org.apache.maven_3.0.5

Java version: 1.7.0_45, vendor: Oracle Corporation

Java home: c:\java\jdk1.7.0\jre

Default locale: en_US, platform encoding: Cp1252

OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

 

C:\rpatrick\work\src\maven\lifecycle-phase\test-project>mvn install

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building lifecycle-phase-plugin-test 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- lifecycle-phases-plugin:1.0:phase-name (validate-phase) @ lifecycle-p

hase-plugin-test ---

[INFO] [phase-name] Maven lifecycle phase is validate

[INFO]

[INFO] --- lifecycle-phases-plugin:1.0:phase-name (compile-phase) @ lifecycle-ph

ase-plugin-test ---

[INFO] [phase-name] Maven lifecycle phase is compile

[INFO]

[INFO] --- lifecycle-phases-plugin:1.0:phase-name (process-classes-phase) @ life

cycle-phase-plugin-test ---

[INFO] [phase-name] Maven lifecycle phase is process-classes

[INFO]

[INFO] --- lifecycle-phases-plugin:1.0:phase-name (package-phase) @ lifecycle-ph

ase-plugin-test ---

[INFO] [phase-name] Maven lifecycle phase is package

[INFO]

[INFO] --- lifecycle-phases-plugin:1.0:phase-name (pre-integration-test-phase) @

lifecycle-phase-plugin-test ---

[INFO] [phase-name] Maven lifecycle phase is pre-integration-test

[INFO]

[INFO] --- lifecycle-phases-plugin:1.0:phase-name (post-integration-test-phase)

@ lifecycle-phase-plugin-test ---

[INFO] [phase-name] Maven lifecycle phase is post-integration-test

[INFO]

[INFO] --- lifecycle-phases-plugin:1.0:phase-name (verify-phase) @ lifecycle-pha

se-plugin-test ---

[INFO] [phase-name] Maven lifecycle phase is verify

[INFO]

[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ lifecycle-phas

e-plugin-test ---

[INFO] Installing C:\rpatrick\work\src\maven\lifecycle-phase\test-project\pom.xm

l to C:\Users\rpatrick\.m2\repository\test\lifecycle-phase-plugin-test\1.0-SNAPS

HOT\lifecycle-phase-plugin-test-1.0-SNAPSHOT.pom

[INFO]

[INFO] --- lifecycle-phases-plugin:1.0:phase-name (install-phase) @ lifecycle-ph

ase-plugin-test ---

[INFO] [phase-name] Maven lifecycle phase is install

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 0.880s

[INFO] Finished at: Mon Dec 30 16:55:29 CST 2013

[INFO] Final Memory: 14M/490M

[INFO] ------------------------------------------------------------------------

 

 

 

--

Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com>

VP, FMW Platform Architecture

Oracle Corporation                                Office: +1.940.725.0011

1148 Triple Crown Court                                 Fax: +1.940.725.0012

Bartonville, TX 76226, USA                    Mobile: +1.469.556.9450

 

HYPERLINK "http://www.amazon.com/Professional-Oracle-WebLogic-Server-Patrick/dp/0470484306/"Professional Oracle WebLogic Server

by Robert Patrick, Gregory Nyberg, and Philip Aston

with Josh Bregman and Paul Done

Book Home Page: HYPERLINK "http://www.wrox.com/WileyCDA/WroxTitle/Professional-Oracle-WebLogic-Server.productCd-0470484306.html"http://www.wrox.com/

Kindle Version: HYPERLINK "http://www.amazon.com/Professional-Oracle-WebLogic-Server-ebook/dp/B004HD69J2/"http://www.amazon.com/

 

 

From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Monday, December 30, 2013 3:41 PM
To: Maven Developers List; Robert Patrick
Subject: RE: Plugin phase awareness...

 

operational with JDK-1.6 but compiling and running with Oracle Java version=1.7.0.25 reproduces the bug

JDK: 1.6
mvn -version=3.0.2
maven-core:3.0
maven-plugin-annotations:3.2
test-project>mvn -e -X -o compile
[INFO] [phase-name]  Maven lifecycle phase is compile (correct)

JDK: 1.6
mvn -version =3.0.5
maven-core:3.0
maven-plugin-annotations:3.2
test-project>mvn -e -X -o compile
[INFO] [phase-name] Maven lifecycle phase is compile (correct)
 
JDK: 1.6
mvn -version=3.1.1
maven-core:3.0
maven-plugin-annotations:3.2
test-project>mvn -e -X -o compile
[INFO] [phase-name] Maven lifecycle phase is compile (correct)
 
----------------------------------JDK-1.7.0.25------------------------------
BASH>mvn -version
Apache Maven 3.0.2 (r1056850; 2011-01-08 19:58:10-0500)
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: jdk1.7.0_25/jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

mvn -version=3.0.2
maven-core:3.0
maven-plugin-annotations:3.2
 
test-project>mvn -e -X -o compile
[INFO] [phase-name] Maven lifecycle phase is validate
 
i wonder if Mr Gosling could possibly shed some light on this ?

Thanks Robert,
Martin-

  

> Date: Mon, 30 Dec 2013 08:07:46 -0800
> From: HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com
> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> 
> I had attached it to the last email but you can grab it here: https://dl.dropboxusercontent.com/u/78116035/maven/lifecycle-phase.zip 
> 
> Hope this helps,
> Robert
> 
> --
> Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com>
> VP, FMW Platform Architecture
> Oracle Corporation Office: +1.940.725.0011
> 1148 Triple Crown Court Fax: +1.940.725.0012
> Bartonville, TX 76226, USA Mobile: +1.469.556.9450
> 
> Professional Oracle WebLogic Server
> by Robert Patrick, Gregory Nyberg, and Philip Aston
> with Josh Bregman and Paul Done
> Book Home Page: http://www.wrox.com/
> Kindle Version: http://www.amazon.com/
> 
> 
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com] 
> Sent: Monday, December 30, 2013 10:02 AM
> To: Maven Developers List
> Subject: RE: Plugin phase awareness...
> 
> 
> Good Morning Patrick
> 
> could you upload plugin and test-harness somewhere (and let me have access).. I would really like to get this working (and close out this bug)
> 
> Many Thanks for your help (and support)!
> Martin Gainty
> ______________________________________________ 
> 
> Inte förändra och störa denna överföring tack
> 
> 
> 
> 
> 
> Date: Mon, 30 Dec 2013 07:46:49 -0800
> From: HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com
> To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> 
> Seems to work properly with Maven 3.0.5 anyway. See attached plugin and test project.
> 
> 
> --
> Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com> VP, FMW Platform Architecture
> Oracle Corporation Office: +1.940.725.0011
> 1148 Triple Crown Court Fax: +1.940.725.0012
> Bartonville, TX 76226, USA Mobile: +1.469.556.9450
> 
> Professional Oracle WebLogic Server
> by Robert Patrick, Gregory Nyberg, and Philip Aston with Josh Bregman and Paul Done Book Home Page: http://www.wrox.com/ Kindle Version: http://www.amazon.com/
> 
> 
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Sunday, December 29, 2013 7:25 PM
> To: Maven Developers List
> Subject: RE: Plugin phase awareness...
> 
> 
> 
> 
> 
> > From: HYPERLINK "mailto:mgainty@hotmail.com"mgainty@hotmail.com
> > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > Subject: RE: Plugin phase awareness...
> > Date: Sun, 29 Dec 2013 17:46:29 -0500
> > 
> > 
> > 
> > 
> > 
> > 
> > > Date: Sun, 29 Dec 2013 15:13:12 +0000
> > > Subject: Re: Plugin phase awareness...
> > > From: HYPERLINK "mailto:stephen.alan.connolly@gmail.com"stephen.alan.connolly@gmail.com
> > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > > 
> > > Are you running the mojo directly in your testing by any chance?
> > > 
> > > Eg
> > > 
> > > mvn short-name:goal
> > MG>Correct I was testing in this fashion
> > 
> > > As opposed to
> > > 
> > > mvn phase
> > MG>Thanks Stephen I will try this out
> MG_12_29_2013>
> /**
> * @parameter expression="${mojoExecution}"
> */
> @Parameter(defaultValue = "${mojoExecution}") private org.apache.maven.plugin.MojoExecution execution; //supposedly mojoExecution injected here public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } //accessor for execution
> /**
> * @parameter expression="${mojoExecution.lifecyclePhase}"
> */
> @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
> private String lifecyclePhase; //supposedly lifecyclePhase is injected here
> public org.apache.maven.model.Plugin plugin=new org.apache.maven.model.Plugin();
> public String getLifecyclePhase() { //accessor for lifecyclePhase
> 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;
> }
> 
> MG_12_29_2013>public void testCompilerBasic() throws Exception {
> System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()= "+getLifecyclePhase());
> 
> MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst MG_12_29_2013>CompilerMojoTestCase::getLifecyclePhase goal=compile executionId=executionId
> MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()= null
> 
> MG_12_29_2013>My thinking is that lifecyclePhase is somehow not being injected..
> MG_12_29_2013>Ideas?
> > 
> > > Because if the former, then the phase is null as the execution was 
> > > not bound to a phase.
> > > 
> > > I have not used this specific property before, so cannot speak to 
> > > whether it works when bound to a phase, but if your test plugin 
> > > execution is not bound to a phase then you would not expect to see a 
> > > non null value
> > > 
> > > On Sunday, 29 December 2013, Martin Gainty wrote:
> > > 
> > > > Morning All-
> > > >
> > > >
> > > >
> > > > Even after downloading maven-core 3.1.1 source and re-compiling to 
> > > > new maven-core-3.1.1.jar distro and forcing maven-core-3.1.1 
> > > > dependency into maven-surefire-plugin
> > > >
> > > >
> > > > I could not get ${mojoExecution.lifecyclePhase} to display 
> > > > anything other than null
> > > >
> > > >
> > > > https://jira.codehaus.org/browse/MNG-5555
> > > >
> > > >
> > > >
> > > > Ideas?
> > > >
> > > > Martin --
> > > > ______________________________________________
> > > >
> > > >
> > > > Inte förändra och störa denna överföring
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > From: HYPERLINK "mailto:mgainty@hotmail.com"mgainty@hotmail.com <javascript:;>
> > > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org <javascript:;>
> > > > Subject: RE: Plugin phase awareness...
> > > > Date: Wed, 25 Dec 2013 22:40:07 -0500
> > > >
> > > >
> > > >
> > > >
> > > > Wasted an enormous amount of time chasing the exact location of 
> > > > .git file.. i guess its a good thing it was Christmas
> > > >
> > > > Thanks Jason!
> > > > Martin Gainty
> > > > ______________________________________________
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > > From: HYPERLINK "mailto:jpyeron@pdinc.us"jpyeron@pdinc.us
> > > > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > > > > Subject: RE: Plugin phase awareness...
> > > > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Martin Gainty
> > > > > > Sent: Wednesday, December 25, 2013 10:40
> > > > > >
> > > > > > bash>git clone
> > > > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-co
> > > > > > bash>re src
> > > > > > Cloning into 'src'...
> > > > > > fatal: repository
> > > > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > > > not found
> > > > >
> > > > > It is not like subversion, git clone 
> > > > > https://github.com/apache/maven.git
> > > > >
> > > > > The git operation will have to happen from the root of the 
> > > > > repository,
> > > > and git
> > > > > hub does not auto redirect git clones to the proper url from the 
> > > > > repo
> > > > browser
> > > > > urls.
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > > > From: HYPERLINK "mailto:igor@ifedorenko.com"igor@ifedorenko.com
> > > > > > > To: HYPERLINK "mailto:dev@maven.apache.org"dev@maven.apache.org
> > > > > > > Subject: Re: Plugin phase awareness...
> > > > > > >
> > > > > > >
> > > > > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/sr
> > > > > > c/main/j
> > > > > > > ava/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: HYPERLINK "mailto:mgainty@hotmail.com"mgainty@hotmail.com
> > > > > > > >> To: HYPERLINK "mailto:dev@maven.apache.org"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}"
> > > > > > > >> */
> > > > > > > >> @Pa
> > > 
> > > 
> > > 
> > > --
> > > Sent from my phone
> > 
> 
> 
> --------------------------------------------------------------------- To unsubscribe, e-mail: HYPERLINK "mailto:dev-unsubscribe@maven.apache.org"dev-unsubscribe@maven.apache.org For additional commands, e-mail: HYPERLINK "mailto:dev-help@maven.apache.org"dev-help@maven.apache.org 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: HYPERLINK "mailto:dev-unsubscribe@maven.apache.org"dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: HYPERLINK "mailto:dev-help@maven.apache.org"dev-help@maven.apache.org
> 

RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
operational with JDK-1.6 but compiling and running with Oracle Java version=1.7.0.25 reproduces the bug


JDK: 1.6

mvn -version=3.0.2

maven-core:3.0

maven-plugin-annotations:3.2

test-project>mvn -e -X -o compile

[INFO] [phase-name]  Maven lifecycle phase is compile (correct)


JDK: 1.6

mvn -version =3.0.5
maven-core:3.0

maven-plugin-annotations:3.2

test-project>mvn -e -X -o compile

[INFO] [phase-name] Maven lifecycle phase is compile (correct)

 

JDK: 1.6

mvn -version=3.1.1

maven-core:3.0

maven-plugin-annotations:3.2

test-project>mvn -e -X -o compile

[INFO] [phase-name] Maven lifecycle phase is compile (correct)

 

----------------------------------JDK-1.7.0.25------------------------------
BASH>mvn -version
Apache Maven 3.0.2 (r1056850; 2011-01-08 19:58:10-0500)
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: jdk1.7.0_25/jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"


mvn -version=3.0.2

maven-core:3.0

maven-plugin-annotations:3.2

 

test-project>mvn -e -X -o compile

[INFO] [phase-name] Maven lifecycle phase is validate

 

i wonder if Mr Gosling could possibly shed some light on this ?

Thanks Robert,

Martin-

  



> Date: Mon, 30 Dec 2013 08:07:46 -0800
> From: robert.patrick@oracle.com
> To: dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> 
> I had attached it to the last email but you can grab it here: https://dl.dropboxusercontent.com/u/78116035/maven/lifecycle-phase.zip 
> 
> Hope this helps,
> Robert
> 
> --
> Robert Patrick <ro...@oracle.com>
> VP, FMW Platform Architecture
> Oracle Corporation Office: +1.940.725.0011
> 1148 Triple Crown Court Fax: +1.940.725.0012
> Bartonville, TX 76226, USA Mobile: +1.469.556.9450
> 
> Professional Oracle WebLogic Server
> by Robert Patrick, Gregory Nyberg, and Philip Aston
> with Josh Bregman and Paul Done
> Book Home Page: http://www.wrox.com/
> Kindle Version: http://www.amazon.com/
> 
> 
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com] 
> Sent: Monday, December 30, 2013 10:02 AM
> To: Maven Developers List
> Subject: RE: Plugin phase awareness...
> 
> 
> Good Morning Patrick
> 
> could you upload plugin and test-harness somewhere (and let me have access).. I would really like to get this working (and close out this bug)
> 
> Many Thanks for your help (and support)!
> Martin Gainty
> ______________________________________________ 
> 
> Inte förändra och störa denna överföring tack
> 
> 
> 
> 
> 
> Date: Mon, 30 Dec 2013 07:46:49 -0800
> From: robert.patrick@oracle.com
> To: dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> 
> Seems to work properly with Maven 3.0.5 anyway. See attached plugin and test project.
> 
> 
> --
> Robert Patrick <ro...@oracle.com> VP, FMW Platform Architecture
> Oracle Corporation Office: +1.940.725.0011
> 1148 Triple Crown Court Fax: +1.940.725.0012
> Bartonville, TX 76226, USA Mobile: +1.469.556.9450
> 
> Professional Oracle WebLogic Server
> by Robert Patrick, Gregory Nyberg, and Philip Aston with Josh Bregman and Paul Done Book Home Page: http://www.wrox.com/ Kindle Version: http://www.amazon.com/
> 
> 
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Sunday, December 29, 2013 7:25 PM
> To: Maven Developers List
> Subject: RE: Plugin phase awareness...
> 
> 
> 
> 
> 
> > From: mgainty@hotmail.com
> > To: dev@maven.apache.org
> > Subject: RE: Plugin phase awareness...
> > Date: Sun, 29 Dec 2013 17:46:29 -0500
> > 
> > 
> > 
> > 
> > 
> > 
> > > Date: Sun, 29 Dec 2013 15:13:12 +0000
> > > Subject: Re: Plugin phase awareness...
> > > From: stephen.alan.connolly@gmail.com
> > > To: dev@maven.apache.org
> > > 
> > > Are you running the mojo directly in your testing by any chance?
> > > 
> > > Eg
> > > 
> > > mvn short-name:goal
> > MG>Correct I was testing in this fashion
> > 
> > > As opposed to
> > > 
> > > mvn phase
> > MG>Thanks Stephen I will try this out
> MG_12_29_2013>
> /**
> * @parameter expression="${mojoExecution}"
> */
> @Parameter(defaultValue = "${mojoExecution}") private org.apache.maven.plugin.MojoExecution execution; //supposedly mojoExecution injected here public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } //accessor for execution
> /**
> * @parameter expression="${mojoExecution.lifecyclePhase}"
> */
> @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
> private String lifecyclePhase; //supposedly lifecyclePhase is injected here
> public org.apache.maven.model.Plugin plugin=new org.apache.maven.model.Plugin();
> public String getLifecyclePhase() { //accessor for lifecyclePhase
> 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;
> }
> 
> MG_12_29_2013>public void testCompilerBasic() throws Exception {
> System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()= "+getLifecyclePhase());
> 
> MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst MG_12_29_2013>CompilerMojoTestCase::getLifecyclePhase goal=compile executionId=executionId
> MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()= null
> 
> MG_12_29_2013>My thinking is that lifecyclePhase is somehow not being injected..
> MG_12_29_2013>Ideas?
> > 
> > > Because if the former, then the phase is null as the execution was 
> > > not bound to a phase.
> > > 
> > > I have not used this specific property before, so cannot speak to 
> > > whether it works when bound to a phase, but if your test plugin 
> > > execution is not bound to a phase then you would not expect to see a 
> > > non null value
> > > 
> > > On Sunday, 29 December 2013, Martin Gainty wrote:
> > > 
> > > > Morning All-
> > > >
> > > >
> > > >
> > > > Even after downloading maven-core 3.1.1 source and re-compiling to 
> > > > new maven-core-3.1.1.jar distro and forcing maven-core-3.1.1 
> > > > dependency into maven-surefire-plugin
> > > >
> > > >
> > > > I could not get ${mojoExecution.lifecyclePhase} to display 
> > > > anything other than null
> > > >
> > > >
> > > > https://jira.codehaus.org/browse/MNG-5555
> > > >
> > > >
> > > >
> > > > Ideas?
> > > >
> > > > Martin --
> > > > ______________________________________________
> > > >
> > > >
> > > > Inte förändra och störa denna överföring
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > From: mgainty@hotmail.com <javascript:;>
> > > > To: dev@maven.apache.org <javascript:;>
> > > > Subject: RE: Plugin phase awareness...
> > > > Date: Wed, 25 Dec 2013 22:40:07 -0500
> > > >
> > > >
> > > >
> > > >
> > > > Wasted an enormous amount of time chasing the exact location of 
> > > > .git file.. i guess its a good thing it was Christmas
> > > >
> > > > Thanks Jason!
> > > > Martin Gainty
> > > > ______________________________________________
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > > From: jpyeron@pdinc.us
> > > > > To: dev@maven.apache.org
> > > > > Subject: RE: Plugin phase awareness...
> > > > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Martin Gainty
> > > > > > Sent: Wednesday, December 25, 2013 10:40
> > > > > >
> > > > > > bash>git clone
> > > > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-co
> > > > > > bash>re src
> > > > > > Cloning into 'src'...
> > > > > > fatal: repository
> > > > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > > > not found
> > > > >
> > > > > It is not like subversion, git clone 
> > > > > https://github.com/apache/maven.git
> > > > >
> > > > > The git operation will have to happen from the root of the 
> > > > > repository,
> > > > and git
> > > > > hub does not auto redirect git clones to the proper url from the 
> > > > > repo
> > > > browser
> > > > > urls.
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > > > From: igor@ifedorenko.com
> > > > > > > To: dev@maven.apache.org
> > > > > > > Subject: Re: Plugin phase awareness...
> > > > > > >
> > > > > > >
> > > > > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/sr
> > > > > > c/main/j
> > > > > > > ava/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: mgainty@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}"
> > > > > > > >> */
> > > > > > > >> @Pa
> > > 
> > > 
> > > 
> > > --
> > > Sent from my phone
> > 
> 
> 
> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
 		 	   		  

RE: Plugin phase awareness...

Posted by Robert Patrick <ro...@oracle.com>.
I had attached it to the last email but you can grab it here:  https://dl.dropboxusercontent.com/u/78116035/maven/lifecycle-phase.zip 

Hope this helps,
Robert

--
Robert Patrick <ro...@oracle.com>
VP, FMW Platform Architecture
Oracle Corporation			Office: +1.940.725.0011
1148 Triple Crown Court			Fax: +1.940.725.0012
Bartonville, TX 76226, USA		Mobile: +1.469.556.9450

Professional Oracle WebLogic Server
by Robert Patrick, Gregory Nyberg, and Philip Aston
with Josh Bregman and Paul Done
Book Home Page: http://www.wrox.com/
Kindle Version: http://www.amazon.com/


-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Monday, December 30, 2013 10:02 AM
To: Maven Developers List
Subject: RE: Plugin phase awareness...

 
Good Morning Patrick

could you upload plugin and test-harness somewhere (and let me have access).. I would really like to get this working (and close out this bug)

Many Thanks for your help (and support)!
Martin Gainty
______________________________________________ 

Inte förändra och störa denna överföring tack


  


Date: Mon, 30 Dec 2013 07:46:49 -0800
From: robert.patrick@oracle.com
To: dev@maven.apache.org
Subject: RE: Plugin phase awareness...

Seems to work properly with Maven 3.0.5 anyway.  See attached plugin and test project.
 
 
--
Robert Patrick <ro...@oracle.com> VP, FMW Platform Architecture
Oracle Corporation			Office: +1.940.725.0011
1148 Triple Crown Court			Fax: +1.940.725.0012
Bartonville, TX 76226, USA		Mobile: +1.469.556.9450
 
Professional Oracle WebLogic Server
by Robert Patrick, Gregory Nyberg, and Philip Aston with Josh Bregman and Paul Done Book Home Page: http://www.wrox.com/ Kindle Version: http://www.amazon.com/
 
 
-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Sunday, December 29, 2013 7:25 PM
To: Maven Developers List
Subject: RE: Plugin phase awareness...
 
 
  
 
 
> From: mgainty@hotmail.com
> To: dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> Date: Sun, 29 Dec 2013 17:46:29 -0500
> 
> 
> 
> 
> 
> 
> > Date: Sun, 29 Dec 2013 15:13:12 +0000
> > Subject: Re: Plugin phase awareness...
> > From: stephen.alan.connolly@gmail.com
> > To: dev@maven.apache.org
> > 
> > Are you running the mojo directly in your testing by any chance?
> > 
> > Eg
> > 
> > mvn short-name:goal
> MG>Correct I was testing in this fashion
> 
> > As opposed to
> > 
> > mvn phase
> MG>Thanks Stephen I will try this out
MG_12_29_2013>
 /**
  * @parameter expression="${mojoExecution}"
  */
 @Parameter(defaultValue = "${mojoExecution}")  private org.apache.maven.plugin.MojoExecution execution; //supposedly mojoExecution injected here  public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } //accessor for execution
 /**
  * @parameter expression="${mojoExecution.lifecyclePhase}"
  */
    @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
    private String lifecyclePhase; //supposedly lifecyclePhase is injected here
    public org.apache.maven.model.Plugin plugin=new org.apache.maven.model.Plugin();
    public String getLifecyclePhase() { //accessor for lifecyclePhase
       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;
 }
 
MG_12_29_2013>public void testCompilerBasic() throws Exception {
  System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     "+getLifecyclePhase());
 
MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst MG_12_29_2013>CompilerMojoTestCase::getLifecyclePhase goal=compile executionId=executionId
MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     null
 
MG_12_29_2013>My thinking is that lifecyclePhase is somehow not being injected..
MG_12_29_2013>Ideas?
> 
> > Because if the former, then the phase is null as the execution was 
> > not bound to a phase.
> > 
> > I have not used this specific property before, so cannot speak to 
> > whether it works when bound to a phase, but if your test plugin 
> > execution is not bound to a phase then you would not expect to see a 
> > non null value
> > 
> > On Sunday, 29 December 2013, Martin Gainty wrote:
> > 
> > > Morning All-
> > >
> > >
> > >
> > > Even after downloading maven-core 3.1.1 source and re-compiling to 
> > > new maven-core-3.1.1.jar distro and forcing maven-core-3.1.1 
> > > dependency into maven-surefire-plugin
> > >
> > >
> > > I could not get ${mojoExecution.lifecyclePhase} to display 
> > > anything other than null
> > >
> > >
> > > https://jira.codehaus.org/browse/MNG-5555
> > >
> > >
> > >
> > > Ideas?
> > >
> > > Martin --
> > > ______________________________________________
> > >
> > >
> > > Inte förändra och störa denna överföring
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > From: mgainty@hotmail.com <javascript:;>
> > > To: dev@maven.apache.org <javascript:;>
> > > Subject: RE: Plugin phase awareness...
> > > Date: Wed, 25 Dec 2013 22:40:07 -0500
> > >
> > >
> > >
> > >
> > > Wasted an enormous amount of time chasing the exact location of 
> > > .git file.. i guess its a good thing it was Christmas
> > >
> > > Thanks Jason!
> > > Martin Gainty
> > > ______________________________________________
> > >
> > >
> > >
> > >
> > >
> > > > From: jpyeron@pdinc.us
> > > > To: dev@maven.apache.org
> > > > Subject: RE: Plugin phase awareness...
> > > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > > >
> > > > > -----Original Message-----
> > > > > From: Martin Gainty
> > > > > Sent: Wednesday, December 25, 2013 10:40
> > > > >
> > > > > bash>git clone
> > > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-co
> > > > > bash>re src
> > > > > Cloning into 'src'...
> > > > > fatal: repository
> > > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > > not found
> > > >
> > > > It is not like subversion, git clone 
> > > > https://github.com/apache/maven.git
> > > >
> > > > The git operation will have to happen from the root of the 
> > > > repository,
> > > and git
> > > > hub does not auto redirect git clones to the proper url from the 
> > > > repo
> > > browser
> > > > urls.
> > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > > From: igor@ifedorenko.com
> > > > > > To: dev@maven.apache.org
> > > > > > Subject: Re: Plugin phase awareness...
> > > > > >
> > > > > >
> > > > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/sr
> > > > > c/main/j
> > > > > > ava/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: mgainty@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}"
> > > > > > >> */
> > > > > > >> @Pa
> > 
> > 
> > 
> > --
> > Sent from my phone
> 
 		 	   		 

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

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


RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
 
Good Morning Patrick

could you upload plugin and test-harness somewhere (and let me have access).. I would really like to get this working
(and close out this bug)

Many Thanks for your help (and support)!
Martin Gainty 
______________________________________________ 

Inte förändra och störa denna överföring tack


  


Date: Mon, 30 Dec 2013 07:46:49 -0800
From: robert.patrick@oracle.com
To: dev@maven.apache.org
Subject: RE: Plugin phase awareness...

Seems to work properly with Maven 3.0.5 anyway.  See attached plugin and test project.
 
 
--
Robert Patrick <ro...@oracle.com>
VP, FMW Platform Architecture
Oracle Corporation			Office: +1.940.725.0011
1148 Triple Crown Court			Fax: +1.940.725.0012
Bartonville, TX 76226, USA		Mobile: +1.469.556.9450
 
Professional Oracle WebLogic Server
by Robert Patrick, Gregory Nyberg, and Philip Aston
with Josh Bregman and Paul Done
Book Home Page: http://www.wrox.com/
Kindle Version: http://www.amazon.com/
 
 
-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Sunday, December 29, 2013 7:25 PM
To: Maven Developers List
Subject: RE: Plugin phase awareness...
 
 
  
 
 
> From: mgainty@hotmail.com
> To: dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> Date: Sun, 29 Dec 2013 17:46:29 -0500
> 
> 
> 
> 
> 
> 
> > Date: Sun, 29 Dec 2013 15:13:12 +0000
> > Subject: Re: Plugin phase awareness...
> > From: stephen.alan.connolly@gmail.com
> > To: dev@maven.apache.org
> > 
> > Are you running the mojo directly in your testing by any chance?
> > 
> > Eg
> > 
> > mvn short-name:goal
> MG>Correct I was testing in this fashion
> 
> > As opposed to
> > 
> > mvn phase
> MG>Thanks Stephen I will try this out
MG_12_29_2013>
 /**
  * @parameter expression="${mojoExecution}"
  */
 @Parameter(defaultValue = "${mojoExecution}")  private org.apache.maven.plugin.MojoExecution execution; //supposedly mojoExecution injected here  public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } //accessor for execution
 /**
  * @parameter expression="${mojoExecution.lifecyclePhase}"
  */
    @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
    private String lifecyclePhase; //supposedly lifecyclePhase is injected here
    public org.apache.maven.model.Plugin plugin=new org.apache.maven.model.Plugin();
    public String getLifecyclePhase() { //accessor for lifecyclePhase
       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;
 }
 
MG_12_29_2013>public void testCompilerBasic() throws Exception {
  System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     "+getLifecyclePhase());
 
MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst MG_12_29_2013>CompilerMojoTestCase::getLifecyclePhase goal=compile executionId=executionId
MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     null
 
MG_12_29_2013>My thinking is that lifecyclePhase is somehow not being injected..
MG_12_29_2013>Ideas?
> 
> > Because if the former, then the phase is null as the execution was 
> > not bound to a phase.
> > 
> > I have not used this specific property before, so cannot speak to 
> > whether it works when bound to a phase, but if your test plugin 
> > execution is not bound to a phase then you would not expect to see a 
> > non null value
> > 
> > On Sunday, 29 December 2013, Martin Gainty wrote:
> > 
> > > Morning All-
> > >
> > >
> > >
> > > Even after downloading maven-core 3.1.1 source and re-compiling to 
> > > new maven-core-3.1.1.jar distro and forcing maven-core-3.1.1 
> > > dependency into maven-surefire-plugin
> > >
> > >
> > > I could not get ${mojoExecution.lifecyclePhase} to display 
> > > anything other than null
> > >
> > >
> > > https://jira.codehaus.org/browse/MNG-5555
> > >
> > >
> > >
> > > Ideas?
> > >
> > > Martin --
> > > ______________________________________________
> > >
> > >
> > > Inte förändra och störa denna överföring
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > From: mgainty@hotmail.com <javascript:;>
> > > To: dev@maven.apache.org <javascript:;>
> > > Subject: RE: Plugin phase awareness...
> > > Date: Wed, 25 Dec 2013 22:40:07 -0500
> > >
> > >
> > >
> > >
> > > Wasted an enormous amount of time chasing the exact location of 
> > > .git file.. i guess its a good thing it was Christmas
> > >
> > > Thanks Jason!
> > > Martin Gainty
> > > ______________________________________________
> > >
> > >
> > >
> > >
> > >
> > > > From: jpyeron@pdinc.us
> > > > To: dev@maven.apache.org
> > > > Subject: RE: Plugin phase awareness...
> > > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > > >
> > > > > -----Original Message-----
> > > > > From: Martin Gainty
> > > > > Sent: Wednesday, December 25, 2013 10:40
> > > > >
> > > > > bash>git clone
> > > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-co
> > > > > bash>re src
> > > > > Cloning into 'src'...
> > > > > fatal: repository
> > > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > > not found
> > > >
> > > > It is not like subversion, git clone 
> > > > https://github.com/apache/maven.git
> > > >
> > > > The git operation will have to happen from the root of the 
> > > > repository,
> > > and git
> > > > hub does not auto redirect git clones to the proper url from the 
> > > > repo
> > > browser
> > > > urls.
> > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > > From: igor@ifedorenko.com
> > > > > > To: dev@maven.apache.org
> > > > > > Subject: Re: Plugin phase awareness...
> > > > > >
> > > > > >
> > > > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/sr
> > > > > c/main/j
> > > > > > ava/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: mgainty@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}"
> > > > > > >> */
> > > > > > >> @Pa
> > 
> > 
> > 
> > --
> > Sent from my phone
> 
 		 	   		 

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

RE: Plugin phase awareness...

Posted by Robert Patrick <ro...@oracle.com>.
Seems to work properly with Maven 3.0.5 anyway.  See attached plugin and test project.


--
Robert Patrick <ro...@oracle.com>
VP, FMW Platform Architecture
Oracle Corporation			Office: +1.940.725.0011
1148 Triple Crown Court			Fax: +1.940.725.0012
Bartonville, TX 76226, USA		Mobile: +1.469.556.9450

Professional Oracle WebLogic Server
by Robert Patrick, Gregory Nyberg, and Philip Aston
with Josh Bregman and Paul Done
Book Home Page: http://www.wrox.com/
Kindle Version: http://www.amazon.com/


-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Sunday, December 29, 2013 7:25 PM
To: Maven Developers List
Subject: RE: Plugin phase awareness...


  


> From: mgainty@hotmail.com
> To: dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> Date: Sun, 29 Dec 2013 17:46:29 -0500
> 
> 
> 
> 
> 
> 
> > Date: Sun, 29 Dec 2013 15:13:12 +0000
> > Subject: Re: Plugin phase awareness...
> > From: stephen.alan.connolly@gmail.com
> > To: dev@maven.apache.org
> > 
> > Are you running the mojo directly in your testing by any chance?
> > 
> > Eg
> > 
> > mvn short-name:goal
> MG>Correct I was testing in this fashion
> 
> > As opposed to
> > 
> > mvn phase
> MG>Thanks Stephen I will try this out
MG_12_29_2013>
 /**
  * @parameter expression="${mojoExecution}"
  */
 @Parameter(defaultValue = "${mojoExecution}")  private org.apache.maven.plugin.MojoExecution execution; //supposedly mojoExecution injected here  public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } //accessor for execution
 /**
  * @parameter expression="${mojoExecution.lifecyclePhase}"
  */
    @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
    private String lifecyclePhase; //supposedly lifecyclePhase is injected here
    public org.apache.maven.model.Plugin plugin=new org.apache.maven.model.Plugin();
    public String getLifecyclePhase() { //accessor for lifecyclePhase
       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;
 }

MG_12_29_2013>public void testCompilerBasic() throws Exception {
  System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     "+getLifecyclePhase());

MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst MG_12_29_2013>CompilerMojoTestCase::getLifecyclePhase goal=compile executionId=executionId
MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     null

MG_12_29_2013>My thinking is that lifecyclePhase is somehow not being injected..
MG_12_29_2013>Ideas?
> 
> > Because if the former, then the phase is null as the execution was 
> > not bound to a phase.
> > 
> > I have not used this specific property before, so cannot speak to 
> > whether it works when bound to a phase, but if your test plugin 
> > execution is not bound to a phase then you would not expect to see a 
> > non null value
> > 
> > On Sunday, 29 December 2013, Martin Gainty wrote:
> > 
> > > Morning All-
> > >
> > >
> > >
> > > Even after downloading maven-core 3.1.1 source and re-compiling to 
> > > new maven-core-3.1.1.jar distro and forcing maven-core-3.1.1 
> > > dependency into maven-surefire-plugin
> > >
> > >
> > > I could not get ${mojoExecution.lifecyclePhase} to display 
> > > anything other than null
> > >
> > >
> > > https://jira.codehaus.org/browse/MNG-5555
> > >
> > >
> > >
> > > Ideas?
> > >
> > > Martin --
> > > ______________________________________________
> > >
> > >
> > > Inte förändra och störa denna överföring
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > From: mgainty@hotmail.com <javascript:;>
> > > To: dev@maven.apache.org <javascript:;>
> > > Subject: RE: Plugin phase awareness...
> > > Date: Wed, 25 Dec 2013 22:40:07 -0500
> > >
> > >
> > >
> > >
> > > Wasted an enormous amount of time chasing the exact location of 
> > > .git file.. i guess its a good thing it was Christmas
> > >
> > > Thanks Jason!
> > > Martin Gainty
> > > ______________________________________________
> > >
> > >
> > >
> > >
> > >
> > > > From: jpyeron@pdinc.us
> > > > To: dev@maven.apache.org
> > > > Subject: RE: Plugin phase awareness...
> > > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > > >
> > > > > -----Original Message-----
> > > > > From: Martin Gainty
> > > > > Sent: Wednesday, December 25, 2013 10:40
> > > > >
> > > > > bash>git clone
> > > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-co
> > > > > bash>re src
> > > > > Cloning into 'src'...
> > > > > fatal: repository
> > > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > > not found
> > > >
> > > > It is not like subversion, git clone 
> > > > https://github.com/apache/maven.git
> > > >
> > > > The git operation will have to happen from the root of the 
> > > > repository,
> > > and git
> > > > hub does not auto redirect git clones to the proper url from the 
> > > > repo
> > > browser
> > > > urls.
> > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > > From: igor@ifedorenko.com
> > > > > > To: dev@maven.apache.org
> > > > > > Subject: Re: Plugin phase awareness...
> > > > > >
> > > > > >
> > > > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/sr
> > > > > c/main/j
> > > > > > ava/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: mgainty@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}"
> > > > > > >> */
> > > > > > >> @Pa
> > 
> > 
> > 
> > --
> > Sent from my phone
> 
 		 	   		 

RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
  


> From: mgainty@hotmail.com
> To: dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> Date: Sun, 29 Dec 2013 17:46:29 -0500
> 
> 
> 
> 
> 
> 
> > Date: Sun, 29 Dec 2013 15:13:12 +0000
> > Subject: Re: Plugin phase awareness...
> > From: stephen.alan.connolly@gmail.com
> > To: dev@maven.apache.org
> > 
> > Are you running the mojo directly in your testing by any chance?
> > 
> > Eg
> > 
> > mvn short-name:goal
> MG>Correct I was testing in this fashion
> 
> > As opposed to
> > 
> > mvn phase
> MG>Thanks Stephen I will try this out
MG_12_29_2013>
 /**
  * @parameter expression="${mojoExecution}"
  */
 @Parameter(defaultValue = "${mojoExecution}")
 private org.apache.maven.plugin.MojoExecution execution; //supposedly mojoExecution injected here
 public org.apache.maven.plugin.MojoExecution getExecution() { return execution; } //accessor for execution
 /**
  * @parameter expression="${mojoExecution.lifecyclePhase}"
  */
    @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
    private String lifecyclePhase; //supposedly lifecyclePhase is injected here
    public org.apache.maven.model.Plugin plugin=new org.apache.maven.model.Plugin();
    public String getLifecyclePhase() { //accessor for lifecyclePhase
       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;
 }

MG_12_29_2013>public void testCompilerBasic() throws Exception {
  System.out.println("CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     "+getLifecyclePhase());

MG_12_29_2013>mvn -e -X -o process-test-classes 1> errors.lst
MG_12_29_2013>CompilerMojoTestCase::getLifecyclePhase goal=compile executionId=executionId
MG_12_29_2013>CompilerMojoTestCase::testCompilerBasic LINE 143 getLifeyclePhase()=     null

MG_12_29_2013>My thinking is that lifecyclePhase is somehow not being injected..
MG_12_29_2013>Ideas?
> 
> > Because if the former, then the phase is null as the execution was not
> > bound to a phase.
> > 
> > I have not used this specific property before, so cannot speak to whether
> > it works when bound to a phase, but if your test plugin execution is not
> > bound to a phase then you would not expect to see a non null value
> > 
> > On Sunday, 29 December 2013, Martin Gainty wrote:
> > 
> > > Morning All-
> > >
> > >
> > >
> > > Even after downloading maven-core 3.1.1 source and re-compiling to new
> > > maven-core-3.1.1.jar distro
> > > and forcing maven-core-3.1.1 dependency into maven-surefire-plugin
> > >
> > >
> > > I could not get ${mojoExecution.lifecyclePhase} to display anything other
> > > than null
> > >
> > >
> > > https://jira.codehaus.org/browse/MNG-5555
> > >
> > >
> > >
> > > Ideas?
> > >
> > > Martin --
> > > ______________________________________________
> > >
> > >
> > > Inte förändra och störa denna överföring
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > From: mgainty@hotmail.com <javascript:;>
> > > To: dev@maven.apache.org <javascript:;>
> > > Subject: RE: Plugin phase awareness...
> > > Date: Wed, 25 Dec 2013 22:40:07 -0500
> > >
> > >
> > >
> > >
> > > Wasted an enormous amount of time chasing the exact location of .git
> > > file.. i guess its a good thing it was Christmas
> > >
> > > Thanks Jason!
> > > Martin Gainty
> > > ______________________________________________
> > >
> > >
> > >
> > >
> > >
> > > > From: jpyeron@pdinc.us
> > > > To: dev@maven.apache.org
> > > > Subject: RE: Plugin phase awareness...
> > > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > > >
> > > > > -----Original Message-----
> > > > > From: Martin Gainty
> > > > > Sent: Wednesday, December 25, 2013 10:40
> > > > >
> > > > > bash>git clone
> > > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-core src
> > > > > Cloning into 'src'...
> > > > > fatal: repository
> > > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > > not found
> > > >
> > > > It is not like subversion, git clone https://github.com/apache/maven.git
> > > >
> > > > The git operation will have to happen from the root of the repository,
> > > and git
> > > > hub does not auto redirect git clones to the proper url from the repo
> > > browser
> > > > urls.
> > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > > From: igor@ifedorenko.com
> > > > > > To: dev@maven.apache.org
> > > > > > Subject: Re: Plugin phase awareness...
> > > > > >
> > > > > >
> > > > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/src/main/j
> > > > > > ava/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: mgainty@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}"
> > > > > > >> */
> > > > > > >> @Pa
> > 
> > 
> > 
> > -- 
> > Sent from my phone
> 
 		 	   		  

RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.

  


> Date: Sun, 29 Dec 2013 15:13:12 +0000
> Subject: Re: Plugin phase awareness...
> From: stephen.alan.connolly@gmail.com
> To: dev@maven.apache.org
> 
> Are you running the mojo directly in your testing by any chance?
> 
> Eg
> 
> mvn short-name:goal
MG>Correct I was testing in this fashion
 
> As opposed to
> 
> mvn phase
MG>Thanks Stephen I will try this out
 
> Because if the former, then the phase is null as the execution was not
> bound to a phase.
> 
> I have not used this specific property before, so cannot speak to whether
> it works when bound to a phase, but if your test plugin execution is not
> bound to a phase then you would not expect to see a non null value
> 
> On Sunday, 29 December 2013, Martin Gainty wrote:
> 
> > Morning All-
> >
> >
> >
> > Even after downloading maven-core 3.1.1 source and re-compiling to new
> > maven-core-3.1.1.jar distro
> > and forcing maven-core-3.1.1 dependency into maven-surefire-plugin
> >
> >
> > I could not get ${mojoExecution.lifecyclePhase} to display anything other
> > than null
> >
> >
> > https://jira.codehaus.org/browse/MNG-5555
> >
> >
> >
> > Ideas?
> >
> > Martin --
> > ______________________________________________
> >
> >
> > Inte förändra och störa denna överföring
> >
> >
> >
> >
> >
> >
> >
> > From: mgainty@hotmail.com <javascript:;>
> > To: dev@maven.apache.org <javascript:;>
> > Subject: RE: Plugin phase awareness...
> > Date: Wed, 25 Dec 2013 22:40:07 -0500
> >
> >
> >
> >
> > Wasted an enormous amount of time chasing the exact location of .git
> > file.. i guess its a good thing it was Christmas
> >
> > Thanks Jason!
> > Martin Gainty
> > ______________________________________________
> >
> >
> >
> >
> >
> > > From: jpyeron@pdinc.us
> > > To: dev@maven.apache.org
> > > Subject: RE: Plugin phase awareness...
> > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > >
> > > > -----Original Message-----
> > > > From: Martin Gainty
> > > > Sent: Wednesday, December 25, 2013 10:40
> > > >
> > > > bash>git clone
> > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-core src
> > > > Cloning into 'src'...
> > > > fatal: repository
> > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > not found
> > >
> > > It is not like subversion, git clone https://github.com/apache/maven.git
> > >
> > > The git operation will have to happen from the root of the repository,
> > and git
> > > hub does not auto redirect git clones to the proper url from the repo
> > browser
> > > urls.
> > >
> > > >
> > > >
> > > >
> > > >
> > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > From: igor@ifedorenko.com
> > > > > To: dev@maven.apache.org
> > > > > Subject: Re: Plugin phase awareness...
> > > > >
> > > > >
> > > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/src/main/j
> > > > > ava/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: mgainty@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}"
> > > > > >> */
> > > > > >> @Pa
> 
> 
> 
> -- 
> Sent from my phone
 		 	   		  

Re: Plugin phase awareness...

Posted by Lennart Jörelid <le...@gmail.com>.
This actually provides another way to know how the Mojo was invoked.
Not bad.

:)


2013/12/29 Stephen Connolly <st...@gmail.com>

> Are you running the mojo directly in your testing by any chance?
>
> Eg
>
> mvn short-name:goal
>
> As opposed to
>
> mvn phase
>
> Because if the former, then the phase is null as the execution was not
> bound to a phase.
>
> I have not used this specific property before, so cannot speak to whether
> it works when bound to a phase, but if your test plugin execution is not
> bound to a phase then you would not expect to see a non null value
>
> On Sunday, 29 December 2013, Martin Gainty wrote:
>
> > Morning All-
> >
> >
> >
> > Even after downloading maven-core 3.1.1 source and re-compiling to new
> > maven-core-3.1.1.jar distro
> > and forcing maven-core-3.1.1 dependency into maven-surefire-plugin
> >
> >
> > I could not get ${mojoExecution.lifecyclePhase} to display anything other
> > than null
> >
> >
> > https://jira.codehaus.org/browse/MNG-5555
> >
> >
> >
> > Ideas?
> >
> > Martin --
> > ______________________________________________
> >
> >
> > Inte förändra och störa denna överföring
> >
> >
> >
> >
> >
> >
> >
> > From: mgainty@hotmail.com <javascript:;>
> > To: dev@maven.apache.org <javascript:;>
> > Subject: RE: Plugin phase awareness...
> > Date: Wed, 25 Dec 2013 22:40:07 -0500
> >
> >
> >
> >
> > Wasted an enormous amount of time chasing the exact location of .git
> > file.. i guess its a good thing it was Christmas
> >
> > Thanks Jason!
> > Martin Gainty
> > ______________________________________________
> >
> >
> >
> >
> >
> > > From: jpyeron@pdinc.us
> > > To: dev@maven.apache.org
> > > Subject: RE: Plugin phase awareness...
> > > Date: Wed, 25 Dec 2013 10:52:34 -0500
> > >
> > > > -----Original Message-----
> > > > From: Martin Gainty
> > > > Sent: Wednesday, December 25, 2013 10:40
> > > >
> > > > bash>git clone
> > > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-core src
> > > > Cloning into 'src'...
> > > > fatal: repository
> > > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > > not found
> > >
> > > It is not like subversion, git clone
> https://github.com/apache/maven.git
> > >
> > > The git operation will have to happen from the root of the repository,
> > and git
> > > hub does not auto redirect git clones to the proper url from the repo
> > browser
> > > urls.
> > >
> > > >
> > > >
> > > >
> > > >
> > > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > > From: igor@ifedorenko.com
> > > > > To: dev@maven.apache.org
> > > > > Subject: Re: Plugin phase awareness...
> > > > >
> > > > >
> > > >
> https://github.com/apache/maven/blob/maven-3.1.1/maven-core/src/main/j
> > > > > ava/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: mgainty@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}"
> > > > > >> */
> > > > > >> @Pa
>
>
>
> --
> Sent from my phone
>



-- 

--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: lj@jguru.se
| URL:   www.jguru.se
| Phone
| (skype):    jgurueurope
| (intl):     +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+

Re: Plugin phase awareness...

Posted by Stephen Connolly <st...@gmail.com>.
Are you running the mojo directly in your testing by any chance?

Eg

mvn short-name:goal

As opposed to

mvn phase

Because if the former, then the phase is null as the execution was not
bound to a phase.

I have not used this specific property before, so cannot speak to whether
it works when bound to a phase, but if your test plugin execution is not
bound to a phase then you would not expect to see a non null value

On Sunday, 29 December 2013, Martin Gainty wrote:

> Morning All-
>
>
>
> Even after downloading maven-core 3.1.1 source and re-compiling to new
> maven-core-3.1.1.jar distro
> and forcing maven-core-3.1.1 dependency into maven-surefire-plugin
>
>
> I could not get ${mojoExecution.lifecyclePhase} to display anything other
> than null
>
>
> https://jira.codehaus.org/browse/MNG-5555
>
>
>
> Ideas?
>
> Martin --
> ______________________________________________
>
>
> Inte förändra och störa denna överföring
>
>
>
>
>
>
>
> From: mgainty@hotmail.com <javascript:;>
> To: dev@maven.apache.org <javascript:;>
> Subject: RE: Plugin phase awareness...
> Date: Wed, 25 Dec 2013 22:40:07 -0500
>
>
>
>
> Wasted an enormous amount of time chasing the exact location of .git
> file.. i guess its a good thing it was Christmas
>
> Thanks Jason!
> Martin Gainty
> ______________________________________________
>
>
>
>
>
> > From: jpyeron@pdinc.us
> > To: dev@maven.apache.org
> > Subject: RE: Plugin phase awareness...
> > Date: Wed, 25 Dec 2013 10:52:34 -0500
> >
> > > -----Original Message-----
> > > From: Martin Gainty
> > > Sent: Wednesday, December 25, 2013 10:40
> > >
> > > bash>git clone
> > > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-core src
> > > Cloning into 'src'...
> > > fatal: repository
> > > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > > not found
> >
> > It is not like subversion, git clone https://github.com/apache/maven.git
> >
> > The git operation will have to happen from the root of the repository,
> and git
> > hub does not auto redirect git clones to the proper url from the repo
> browser
> > urls.
> >
> > >
> > >
> > >
> > >
> > > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > > From: igor@ifedorenko.com
> > > > To: dev@maven.apache.org
> > > > Subject: Re: Plugin phase awareness...
> > > >
> > > >
> > > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/src/main/j
> > > > ava/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: mgainty@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}"
> > > > >> */
> > > > >> @Pa



-- 
Sent from my phone

RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
Morning All-

 

Even after downloading maven-core 3.1.1 source and re-compiling to new maven-core-3.1.1.jar distro
and forcing maven-core-3.1.1 dependency into maven-surefire-plugin

 
I could not get ${mojoExecution.lifecyclePhase} to display anything other than null


https://jira.codehaus.org/browse/MNG-5555

 

Ideas?

Martin --
______________________________________________ 


Inte förändra och störa denna överföring

  





From: mgainty@hotmail.com
To: dev@maven.apache.org
Subject: RE: Plugin phase awareness...
Date: Wed, 25 Dec 2013 22:40:07 -0500




Wasted an enormous amount of time chasing the exact location of .git file.. i guess its a good thing it was Christmas

Thanks Jason!
Martin Gainty 
______________________________________________ 


  


> From: jpyeron@pdinc.us
> To: dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> Date: Wed, 25 Dec 2013 10:52:34 -0500
> 
> > -----Original Message-----
> > From: Martin Gainty 
> > Sent: Wednesday, December 25, 2013 10:40
> > 
> > bash>git clone 
> > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-core src
> > Cloning into 'src'...
> > fatal: repository 
> > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > not found
> 
> It is not like subversion, git clone https://github.com/apache/maven.git
> 
> The git operation will have to happen from the root of the repository, and git
> hub does not auto redirect git clones to the proper url from the repo browser
> urls.
> 
> > 
> > 
> > 
> > 
> > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > From: igor@ifedorenko.com
> > > To: dev@maven.apache.org
> > > Subject: Re: Plugin phase awareness...
> > > 
> > > 
> > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/src/main/j
> > > ava/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: mgainty@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.jorelid@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 <mg...@hotmail.com>
> > > >>>
> > > >>>> 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: tamas@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/stagi
> > > >>>> 
> > ng/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/Ab
> > > >>>> stractStagingMojo.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 
> > > >>>>> <ig...@ifedorenko.com>
> > > >>>> 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: lj@jguru.se
> > > >>>>>>> | URL: www.jguru.se
> > > >>>>>>> | Phone
> > > >>>>>>> | (skype): jgurueurope
> > > >>>>>>> | (intl): +46 708 507 603
> > > >>>>>>> | (domestic): 0708 - 507 603
> > > >>>>>>> +==============================+
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>> 
> > ---------------------------------------------------------------
> > > >>>>>> ------ To unsubscribe, e-mail: 
> > dev-unsubscribe@maven.apache.org 
> > > >>>>>> For additional commands, e-mail: dev-help@maven.apache.org
> > > >>>>>>
> > > >>>>>>
> > > >>>>
> > > >>>>
> > > >>>
> > > >>>
> > > >>>
> > > >>> --
> > > >>>
> > > >>> --
> > > >>> +==============================+
> > > >>> | Bästa hälsningar,
> > > >>> | [sw. "Best regards"]
> > > >>> |
> > > >>> | Lennart Jörelid
> > > >>> | EAI Architect & Integrator
> > > >>> |
> > > >>> | jGuru Europe AB
> > > >>> | Mölnlycke - Kista
> > > >>> |
> > > >>> | Email: lj@jguru.se
> > > >>> | URL: www.jguru.se
> > > >>> | Phone
> > > >>> | (skype): jgurueurope
> > > >>> | (intl): +46 708 507 603
> > > >>> | (domestic): 0708 - 507 603
> > > >>> +==============================+
> > > >>
> > > > 
> > > >
> > > 
> > > 
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
> > > additional commands, e-mail: dev-help@maven.apache.org
> > > 
> > 
> >
> 
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> - -
> - Jason Pyeron PD Inc. http://www.pdinc.us -
> - Principal Consultant 10 West 24th Street #100 -
> - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
> - -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> This message is copyright PD Inc, subject to license 20080407P00.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
 		 	   		  

RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
Wasted an enormous amount of time chasing the exact location of .git file.. i guess its a good thing it was Christmas

Thanks Jason!
Martin Gainty 
______________________________________________ 


  


> From: jpyeron@pdinc.us
> To: dev@maven.apache.org
> Subject: RE: Plugin phase awareness...
> Date: Wed, 25 Dec 2013 10:52:34 -0500
> 
> > -----Original Message-----
> > From: Martin Gainty 
> > Sent: Wednesday, December 25, 2013 10:40
> > 
> > bash>git clone 
> > bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-core src
> > Cloning into 'src'...
> > fatal: repository 
> > 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
> > not found
> 
> It is not like subversion, git clone https://github.com/apache/maven.git
> 
> The git operation will have to happen from the root of the repository, and git
> hub does not auto redirect git clones to the proper url from the repo browser
> urls.
> 
> > 
> > 
> > 
> > 
> > > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > > From: igor@ifedorenko.com
> > > To: dev@maven.apache.org
> > > Subject: Re: Plugin phase awareness...
> > > 
> > > 
> > https://github.com/apache/maven/blob/maven-3.1.1/maven-core/src/main/j
> > > ava/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: mgainty@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.jorelid@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 <mg...@hotmail.com>
> > > >>>
> > > >>>> 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: tamas@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/stagi
> > > >>>> 
> > ng/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/Ab
> > > >>>> stractStagingMojo.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 
> > > >>>>> <ig...@ifedorenko.com>
> > > >>>> 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: lj@jguru.se
> > > >>>>>>> | URL: www.jguru.se
> > > >>>>>>> | Phone
> > > >>>>>>> | (skype): jgurueurope
> > > >>>>>>> | (intl): +46 708 507 603
> > > >>>>>>> | (domestic): 0708 - 507 603
> > > >>>>>>> +==============================+
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>> 
> > ---------------------------------------------------------------
> > > >>>>>> ------ To unsubscribe, e-mail: 
> > dev-unsubscribe@maven.apache.org 
> > > >>>>>> For additional commands, e-mail: dev-help@maven.apache.org
> > > >>>>>>
> > > >>>>>>
> > > >>>>
> > > >>>>
> > > >>>
> > > >>>
> > > >>>
> > > >>> --
> > > >>>
> > > >>> --
> > > >>> +==============================+
> > > >>> | Bästa hälsningar,
> > > >>> | [sw. "Best regards"]
> > > >>> |
> > > >>> | Lennart Jörelid
> > > >>> | EAI Architect & Integrator
> > > >>> |
> > > >>> | jGuru Europe AB
> > > >>> | Mölnlycke - Kista
> > > >>> |
> > > >>> | Email: lj@jguru.se
> > > >>> | URL: www.jguru.se
> > > >>> | Phone
> > > >>> | (skype): jgurueurope
> > > >>> | (intl): +46 708 507 603
> > > >>> | (domestic): 0708 - 507 603
> > > >>> +==============================+
> > > >>
> > > > 
> > > >
> > > 
> > > 
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
> > > additional commands, e-mail: dev-help@maven.apache.org
> > > 
> > 
> >
> 
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> - -
> - Jason Pyeron PD Inc. http://www.pdinc.us -
> - Principal Consultant 10 West 24th Street #100 -
> - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
> - -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> This message is copyright PD Inc, subject to license 20080407P00.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
 		 	   		  

RE: Plugin phase awareness...

Posted by Jason Pyeron <jp...@pdinc.us>.
> -----Original Message-----
> From: Martin Gainty 
> Sent: Wednesday, December 25, 2013 10:40
> 
> bash>git clone 
> bash>https://github.com/apache/maven/blob/maven-3.1.1/maven-core src
> Cloning into 'src'...
> fatal: repository 
> 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
>  not found

It is not like subversion, git clone https://github.com/apache/maven.git

The git operation will have to happen from the root of the repository, and git
hub does not auto redirect git clones to the proper url from the repo browser
urls.

> 
>   
> 
> 
> > Date: Tue, 24 Dec 2013 18:51:59 -0500
> > From: igor@ifedorenko.com
> > To: dev@maven.apache.org
> > Subject: Re: Plugin phase awareness...
> > 
> > 
> https://github.com/apache/maven/blob/maven-3.1.1/maven-core/src/main/j
> > ava/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: mgainty@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.jorelid@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 <mg...@hotmail.com>
> > >>>
> > >>>> 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: tamas@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/stagi
> > >>>> 
> ng/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/Ab
> > >>>> stractStagingMojo.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 
> > >>>>> <ig...@ifedorenko.com>
> > >>>> 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: lj@jguru.se
> > >>>>>>> | URL: www.jguru.se
> > >>>>>>> | Phone
> > >>>>>>> | (skype): jgurueurope
> > >>>>>>> | (intl): +46 708 507 603
> > >>>>>>> | (domestic): 0708 - 507 603
> > >>>>>>> +==============================+
> > >>>>>>>
> > >>>>>>>
> > >>>>>> 
> ---------------------------------------------------------------
> > >>>>>> ------ To unsubscribe, e-mail: 
> dev-unsubscribe@maven.apache.org 
> > >>>>>> For additional commands, e-mail: dev-help@maven.apache.org
> > >>>>>>
> > >>>>>>
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>>
> > >>> --
> > >>> +==============================+
> > >>> | Bästa hälsningar,
> > >>> | [sw. "Best regards"]
> > >>> |
> > >>> | Lennart Jörelid
> > >>> | EAI Architect & Integrator
> > >>> |
> > >>> | jGuru Europe AB
> > >>> | Mölnlycke - Kista
> > >>> |
> > >>> | Email: lj@jguru.se
> > >>> | URL: www.jguru.se
> > >>> | Phone
> > >>> | (skype): jgurueurope
> > >>> | (intl): +46 708 507 603
> > >>> | (domestic): 0708 - 507 603
> > >>> +==============================+
> > >>
> > > 
> > >
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
> > additional commands, e-mail: dev-help@maven.apache.org
> > 
>  		 	   		  
>
 
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

 


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


RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
bash>git clone https://github.com/apache/maven/blob/maven-3.1.1/maven-core src
Cloning into 'src'...
fatal: repository 'https://github.com/apache/maven/blob/maven-3.1.1/maven-core/'
 not found

 

?

Martin

--------

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

  


> Date: Tue, 24 Dec 2013 18:51:59 -0500
> From: igor@ifedorenko.com
> To: dev@maven.apache.org
> Subject: 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: mgainty@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.jorelid@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 <mg...@hotmail.com>
> >>>
> >>>> 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: tamas@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 <ig...@ifedorenko.com>
> >>>> 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: lj@jguru.se
> >>>>>>> | URL: www.jguru.se
> >>>>>>> | Phone
> >>>>>>> | (skype): jgurueurope
> >>>>>>> | (intl): +46 708 507 603
> >>>>>>> | (domestic): 0708 - 507 603
> >>>>>>> +==============================+
> >>>>>>>
> >>>>>>>
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>>>>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>>
> >>> --
> >>> +==============================+
> >>> | Bästa hälsningar,
> >>> | [sw. "Best regards"]
> >>> |
> >>> | Lennart Jörelid
> >>> | EAI Architect & Integrator
> >>> |
> >>> | jGuru Europe AB
> >>> | Mölnlycke - Kista
> >>> |
> >>> | Email: lj@jguru.se
> >>> | URL: www.jguru.se
> >>> | Phone
> >>> | (skype): jgurueurope
> >>> | (intl): +46 708 507 603
> >>> | (domestic): 0708 - 507 603
> >>> +==============================+
> >>
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
 		 	   		  

Re: Plugin phase awareness...

Posted by Igor Fedorenko <ig...@ifedorenko.com>.
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: mgainty@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.jorelid@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 <mg...@hotmail.com>
>>>
>>>> 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: tamas@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 <ig...@ifedorenko.com>
>>>> 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: lj@jguru.se
>>>>>>> | URL: www.jguru.se
>>>>>>> | Phone
>>>>>>> | (skype): jgurueurope
>>>>>>> | (intl): +46 708 507 603
>>>>>>> | (domestic): 0708 - 507 603
>>>>>>> +==============================+
>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>>>
>>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> --
>>> +==============================+
>>> | Bästa hälsningar,
>>> | [sw. "Best regards"]
>>> |
>>> | Lennart Jörelid
>>> | EAI Architect & Integrator
>>> |
>>> | jGuru Europe AB
>>> | Mölnlycke - Kista
>>> |
>>> | Email: lj@jguru.se
>>> | URL: www.jguru.se
>>> | Phone
>>> | (skype): jgurueurope
>>> | (intl): +46 708 507 603
>>> | (domestic): 0708 - 507 603
>>> +==============================+
>>
>   		 	   		
>

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


RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
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: mgainty@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.jorelid@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 <mg...@hotmail.com>
> > 
> > > 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: tamas@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 <ig...@ifedorenko.com>
> > > 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: lj@jguru.se
> > > > >> | URL: www.jguru.se
> > > > >> | Phone
> > > > >> | (skype): jgurueurope
> > > > >> | (intl): +46 708 507 603
> > > > >> | (domestic): 0708 - 507 603
> > > > >> +==============================+
> > > > >>
> > > > >>
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: dev-help@maven.apache.org
> > > > >
> > > > >
> > >
> > >
> > 
> > 
> > 
> > -- 
> > 
> > --
> > +==============================+
> > | Bästa hälsningar,
> > | [sw. "Best regards"]
> > |
> > | Lennart Jörelid
> > | EAI Architect & Integrator
> > |
> > | jGuru Europe AB
> > | Mölnlycke - Kista
> > |
> > | Email: lj@jguru.se
> > | URL: www.jguru.se
> > | Phone
> > | (skype): jgurueurope
> > | (intl): +46 708 507 603
> > | (domestic): 0708 - 507 603
> > +==============================+
> 
 		 	   		  

RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
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.jorelid@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 <mg...@hotmail.com>
> 
> > 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: tamas@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 <ig...@ifedorenko.com>
> > 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: lj@jguru.se
> > > >> | URL: www.jguru.se
> > > >> | Phone
> > > >> | (skype): jgurueurope
> > > >> | (intl): +46 708 507 603
> > > >> | (domestic): 0708 - 507 603
> > > >> +==============================+
> > > >>
> > > >>
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: dev-help@maven.apache.org
> > > >
> > > >
> >
> >
> 
> 
> 
> -- 
> 
> --
> +==============================+
> | Bästa hälsningar,
> | [sw. "Best regards"]
> |
> | Lennart Jörelid
> | EAI Architect & Integrator
> |
> | jGuru Europe AB
> | Mölnlycke - Kista
> |
> | Email: lj@jguru.se
> | URL: www.jguru.se
> | Phone
> | (skype): jgurueurope
> | (intl): +46 708 507 603
> | (domestic): 0708 - 507 603
> +==============================+
 		 	   		  

Re: Plugin phase awareness...

Posted by Lennart Jörelid <le...@gmail.com>.
Try just injecting the mojoExecution object.
Then invoke the getLifecyclePhase() method in it.


2013/12/24 Martin Gainty <mg...@hotmail.com>

> 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: tamas@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 <ig...@ifedorenko.com>
> 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: lj@jguru.se
> > >> | URL: www.jguru.se
> > >> | Phone
> > >> | (skype): jgurueurope
> > >> | (intl): +46 708 507 603
> > >> | (domestic): 0708 - 507 603
> > >> +==============================+
> > >>
> > >>
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
>
>



-- 

--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: lj@jguru.se
| URL:   www.jguru.se
| Phone
| (skype):    jgurueurope
| (intl):     +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+

Re: Plugin phase awareness...

Posted by Lennart Jörelid <le...@gmail.com>.
True,

The lifecyclePhase property/getter is not present in the 2.0.X (at least
not until 2.0.8).
You will need to use a Maven dependency of at least 3.0.X for this to work.



2013/12/24 Igor Fedorenko <ig...@ifedorenko.com>

> This works for me just fine, at least from m2e. Tried Maven 3.0.5 and
> 3.1.1.
>
>     @Mojo(name = "test2", defaultPhase = LifecyclePhase.COMPILE)
>     public class Test2Mojo extends AbstractMojo {
>
>
>       @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
>       private String phase;
>
>       public void execute() throws MojoExecutionException,
> MojoFailureException {
>         System.out.println(phase);
>       }
>     }
>
> --
> Regards,
> Igor
>
>
>
> On 12/23/2013, 19:33, Martin Gainty wrote:
>
>> 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: tamas@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 <ig...@ifedorenko.com>
>>> 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: lj@jguru.se
>>>>> | URL: www.jguru.se
>>>>> | Phone
>>>>> | (skype): jgurueurope
>>>>> | (intl): +46 708 507 603
>>>>> | (domestic): 0708 - 507 603
>>>>> +==============================+
>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 

--
+==============================+
| Bästa hälsningar,
| [sw. "Best regards"]
|
| Lennart Jörelid
| EAI Architect & Integrator
|
| jGuru Europe AB
| Mölnlycke - Kista
|
| Email: lj@jguru.se
| URL:   www.jguru.se
| Phone
| (skype):    jgurueurope
| (intl):     +46 708 507 603
| (domestic): 0708 - 507 603
+==============================+

Re: Plugin phase awareness...

Posted by Igor Fedorenko <ig...@ifedorenko.com>.
This works for me just fine, at least from m2e. Tried Maven 3.0.5 and 3.1.1.

     @Mojo(name = "test2", defaultPhase = LifecyclePhase.COMPILE)
     public class Test2Mojo extends AbstractMojo {

       @Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
       private String phase;

       public void execute() throws MojoExecutionException, 
MojoFailureException {
         System.out.println(phase);
       }
     }

--
Regards,
Igor


On 12/23/2013, 19:33, Martin Gainty wrote:
> 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: tamas@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 <ig...@ifedorenko.com> 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: lj@jguru.se
>>>> | URL: www.jguru.se
>>>> | Phone
>>>> | (skype): jgurueurope
>>>> | (intl): +46 708 507 603
>>>> | (domestic): 0708 - 507 603
>>>> +==============================+
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>   		 	   		
>

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


RE: Plugin phase awareness...

Posted by Martin Gainty <mg...@hotmail.com>.
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: tamas@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 <ig...@ifedorenko.com> 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: lj@jguru.se
> >> | URL: www.jguru.se
> >> | Phone
> >> | (skype): jgurueurope
> >> | (intl): +46 708 507 603
> >> | (domestic): 0708 - 507 603
> >> +==============================+
> >>
> >>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
 		 	   		  

Re: Plugin phase awareness...

Posted by Tamás Cservenák <ta...@cservenak.net>.
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 <ig...@ifedorenko.com> 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: lj@jguru.se
>> | URL:   www.jguru.se
>> | Phone
>> | (skype):    jgurueurope
>> | (intl):     +46 708 507 603
>> | (domestic): 0708 - 507 603
>> +==============================+
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Plugin phase awareness...

Posted by Igor Fedorenko <ig...@ifedorenko.com>.
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: lj@jguru.se
> | URL:   www.jguru.se
> | Phone
> | (skype):    jgurueurope
> | (intl):     +46 708 507 603
> | (domestic): 0708 - 507 603
> +==============================+
>

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