You want to pass it to the clover check mojo, and have that passed on to the clover 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>
  <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?

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.

Cheers,
Brett

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]

Reply via email to