maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hilco Wijbenga" <hilco.wijbe...@gmail.com>
Subject Re: Proposal for maven-qc-plugin / maven-qc-report-plugin
Date Sun, 08 Oct 2006 08:26:13 GMT
Hi all,

Wow, that proved *much* easier than I had anticipated. I'm not sure if
everyone is equally happy with the approach I took, though...

I slightly changed my plans and tried to get PMD to run by just
invoking the maven-qc-plugin. I'm invoking mvn clean verify and the
PMD plugin is not configured to run anywhere (no <executions>).

I've got a lifecycle with id qc and a single phase: initialize.

I have created two mojos: QcInitMojo (@phase post-integration-test;
@goal init) which adds a PluginExecution for PMD to the PMD plugin
(defined in a test project's POM). This PluginExecution has id qc,
phase initialize, and goal pmd.

The other mojo is QcMojo (@phase verify; @goal qc; @execute
phase="initialize" lifecycle="qc").

In my test project's POM I have something similar to:
<build><plugins>
<plugin>
<artifactId>maven-qc-plugin</artifactId>
<executions><execution><goals>
<goal>init</goal>
<goal>qc</goal>
</goals></execution></executions>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>
</plugins></build>

So the init goal is run first (in the post-integration-test phase) and
adds an <execution> to the PMD plugin. Then in the verify phase the qc
goal is run and my qc lifecycle is executed. This lifecycle now runs
PMD.

This has led to a number of questions. Firstly, is this the way to go?
Or is it too hackish?

I noticed that I get a warning ([WARNING] Removing: qc from forked
lifecycle, to prevent recursive invocation.). Why? There does not
appear to be any risk of recursive invocation. Both my mojos run much
later than the initialize phase. I don't see this happening with the
Surefire mojo which I used as my example.

I also noticed that except for my mojos all info messages are logged
as [INFO], mine, however, are logged as [info] (lowercase). Why is
that happening?

Finally, why is getConfiguration defined as returning an Object?
Shouldn't that be an Xpp3Dom? I don't like having to upcast. :-(

All in all I'm quite optimistic about the whole idea. It actually
seems possible. :-) Keep up the good work Maven developers!

Cheers,
Hilco

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message