You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brad Jarvinen <Br...@chordiant.com> on 2010/03/17 00:34:03 UTC

Custom lifecycles and getting parameters to them

Hi,

 

For sample purposes, I've defined a custom lifecycle as follows:

 

<lifecycles> 

  <lifecycle> 

    <id>project-archetypes-lifecycle</id> 

    <phases> 

      <phase> 

        <id>validate</id> 

        <executions> 

          <execution> 

            <goals> 

              <goal> 

                org.apache.maven.plugins:maven-archetype-plugin:generate


              </goal> 

            </goals> 

            <configuration> 

              <artifactId>fred</artifactId> 

              <groupId>bob</groupId> 

              <interactiveMode>false</interactiveMode> 

            </configuration> 

          </execution> 

        </executions> 

      </phase> 

    </phases> 

  </lifecycle> 

</lifecycles>

 

And in my Maven plug-in, I've included an annotation to execute the
lifecycle before my mojo executes:

 

* @execute lifecycle="project-archetypes-lifecycle" phase="validate"

 

 

But when I run my plug-in, I get the following error:

 

[WARNING] Property artifactId is missing. Add -DartifactId=someValue

 

It'll only work if I pass -DartifactId to my mojo from the command line.
It seems that configuration element in the lifecycle definition is
ignored for artifactId.  But yet, the interfaceMode=false seems to work.

 

Any ideas how I can pass variable data into the custom lifecycle
definition when I invoke it from another mojo?

 

Thanks,

Brad

 

 

The information transmitted herewith is sensitive      information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.