> -----Original Message-----
> From: Brett Porter [mailto:[EMAIL PROTECTED]
> Sent: lundi 24 octobre 2005 08:56
> To: Maven Developers List
> Subject: Re: Passing properties from one mojo to another with forked
> lifecycle?
> 
> You want to pass it to the clover check mojo, and have that passed on to
> the clover instrument mojo?

Yes, exactly. The user passes it to the clover check mojo and the clover
check mojo somehow passes it to the instrument mojo.
 
> I don't know that that's necessary - if it's shared configuration
> between the two, it should be in the global plugin configuration:
> 
> <plugin>
>    <groupId>org.apache.maven.plugins</groupId>
>    <artifactId>maven-clover-plugin</artifactId>
>    <configuration>
>      <jdk>1.4</jdk>
>    </configuration>

Cool. I didn't realize you could have both executions and general
configuration. This works, thanks!

>    <executions>
>      <execution>
>        <configuration>
>          <targetPercentage>50%</targetPercentage>
>        </configuration>
>        <goals>
>          <goal>check</goal>
>        </goals>
>      </execution>
>    </executions>
> </plugin>
> 
> This works for me as described below.
> 
> Is this sufficient or does it exclude other use cases?

No that's good enough.
 
> I think beyond this we might be getting into plugins that package up
> other plugins like recently discussed on the maven users list, to avoid
> the forking of a lifecycle and instead setup a predefined set of plugins
> and configurations.

Do you mean physically package them, ie. add the dependent plugins to your
plugin's jar?

That would certainly solve issues of plugins not working together and having
to maintain runtime compatible versions.

The cons would be:
- increased disk space (doesn't really matter)
- unability for users to benefit from new features of a dependent plugin.
They would have to wait for a new version of the main plugin to benefit from
them.

-Vincent

> Vincent Massol wrote:
> > Hi,
> >
> > Context
> > ========
> >
> > I'm working on the clover plugin (I'm trying to fix
> > http://jira.codehaus.org/browse/MNG-1136 which seemed simple enough at
> > first).
> >
> > The CloverCheckMojo calls the CloverInstrumentMojo by forking a custom
> > lifecycle.
> >
> > I'm adding a config property (called "jdk") to the CloverInstrumentMojo.
> > However in order for it not to be null at execution I think I need to
> pass
> > it from the CloverCheckMojo.
> >
> > ATM I'm passing other properties by defining them in the custom
> lifecycle.
> >
> > Question
> > =========
> >
> > However I don't know how to reference a property defined in a
> configuration
> > by the user. Also this property should only be passed if it's defined by
> the
> > user (it should be null if not defined by the user).
> >
> > Reproducing the problem
> > ========================
> >
> > I've just committed my changes to the Clover plugin. To reproduce this,
> > build the clover plugin from trunk. Then go to
> > components/examples/maven-clover-plugin-samples and type "mvn install -
> X".
> >
> > Note that the build will fail but that's normal (that's another issue).
> As
> > you've run with -X you will see some logs being printed:
> >
> > [DEBUG] Instrumenting using parameters [[-p, threaded, -f, 100, -i,
> > C:\dev\maven\components\trunk\examples\maven-clover-plugin-sam
> > ples\maven-clover-plugin-sample-simple\target/clover/clover.db, -s,
> > C:\dev\maven\components\trunk\examples\maven-clover-plugin-sam
> > ples\maven-clover-plugin-sample-simple\src\main\java, -d,
> > C:\dev\maven\components\trunk\examples\maven-clover-plugin-samples\maven
> > -clover-plugin-sample-simple\target\clover\src]]
> >
> > If the jdk were passed correctly you should see a ", -jdk14" as the end
> of
> > this string (see CloverInstrumentMojo.createCliArgs() to see what it
> does).
> >
> > Thanks
> > -Vincent
> >
> >
> > ---------------------------------------------------------------------
> > 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