2009/11/9 Ludwig Magnusson <lud...@itcatapult.com>:
> A new question on this subject.
> If I have several goals for the same plugin that I want special
> configuration for and all are run from the command line, not part of any
> phase. Is that possible?

only if the configuration requirements of each goal are orthogonal...

It sounds like you are thinking that Maven is like ANT.  Maven is not
ANT, drink the KoolAid, it's quite tasty! Bind to the lifecycle
invoking goals directly from the cli is usually not what you want to
do

> Maven complains when I define 2 executions with <id>default-cli</id> since
> two executions can't have the same id.
> /Ludwig
>
> -----Original Message-----
> From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com]
> Sent: den 9 november 2009 11:45
> To: Maven Users List
> Subject: Re: Specific goal gonfiguration in maven does not work
>
> 2009/11/9 Ludwig Magnusson <lud...@itcatapult.com>:
>> Hi!
>>
>> I am using the torque plugin for maven and  I am trying to set
> goal-specific
>> configurations but when I run the goal. Maven can't find the parameters.
>>
>>
>>
>> When I do a "global" configuration, everything works. Like this:
>>
>>
>>
>> <plugin>
>>
>>  <groupId>org.apache.torque</groupId>
>>
>>  <artifactId>torque-maven-plugin</artifactId>
>>
>>  <version>4.0-alpha1-SNAPSHOT</version>
>>
>>  <configuration>
>>
>>    //my configuration
>>
>>  </configuration>
>>
>> </plugin>
>>
>
> The above applies to all executions
>
>>
>>
>> But when I do a goal specific configuration the parameters aren't found.
>> Like this:
>>
>>
>>
>> <plugin>
>>
>>  <groupId>org.apache.torque</groupId>
>>
>>  <artifactId>torque-maven-plugin</artifactId>
>>
>>  <version>4.0-alpha1-SNAPSHOT</version>
>>
>>  <executions>
>>
>>    <execution>
>>
>>      <id>my-id</id>
>>
>>      <goals>
>>
>>        <goal>om</goal>
>>
>>      </goals>
>>
>>      <configuration>
>>
>>        //my configuration
>>
>>      </configuration>
>>
>>    </execution>
>>
>>  </executions>
>>
>> </plugin>
>>
>>
>
> the above binds an execution of om to the lifecycle at the phase
> specified in the @phase annotation on your mojo (which could be
> overridden by an <phase>___</phase> in your execution.
>
> The configuration only applies to this execution.
>
> If you have not got either a @phase on your mojo or a <phase> in your
> execution, then maven will not complain and just never execute this
> goal as part of any lifecycle
>
>>
>> In both cases I run mvn torque:om from the command line.
>>
>
> that is execution directly from the CLI, not as part of the lifecycle,
> so will not be picked up
>
> in maven 2.2.1, there is an execution id assigned to cli invocation of
> IIRC default-cli, and this would achieve what you are after
>
>> I'm not really sure about the id-parameter. I have read the documentation
>> but I'm not sure I get it.
>>
>> /Ludwig
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to