Orthogonal? You mean that the all have different parameters?
Well I'm using the torque plugin and sad to say that is not the case.
Example: the parameter outputDir exists for several goals even though the
output is not the same at all for the different goals.

I don't think that maven is like ant. I have never used it myself (other
than running tasks someone else has written).

But the answer to the main question is no? If the parameters have the same
name, I can't have different values for different goals?

/Ludwig

-----Original Message-----
From: Stephen Connolly [mailto:[email protected]] 
Sent: den 9 november 2009 14:17
To: Maven Users List
Subject: Re: Specific goal gonfiguration in maven does not work

2009/11/9 Ludwig Magnusson <[email protected]>:
> 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:[email protected]]
> 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 <[email protected]>:
>> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to