|
The patch I've applied to maven before modifying the clover plugin I forgot to say that the patch I've made above applies to 2.0.6. I expect the same patch to work more or less on 2.0.9. Also the patch isn't cleaned up as the real change should be on the MavenProject class. Will attach a cleaned up patch. Doesn't really matter as the solution isn't going to be accepted as is We've tested the maven patch + pacthed clover on a large scale project (30 modules) and all WAR/EARs ended up generated with full clovered dependencies. Now I just need some input from the maven developers. For into the clover issue is registered here:http://developer.atlassian.com/jira/browse/CLMVN-6 I'd prefer to see this as preventing re-resolution of project dependencies, unless the scope changes upward (compile to test, NOT test to compile)...then, you could impose a rule saying that any pre-existing dependency artifacts in the project are preferred over those new ones just resolved...that way, you'd preserve any swizzled artifacts for the duration of your forked execution. This does get into some interesting side effects for plugins that don't use @requiresDependencyResolution, probably, so it's probably not appropriate for 2.0.x (who knows what sort of regressions this sort of change could introduce). I'd prefer to do a full audit of the mutability of MavenProject for 2.1 from a plugin's point of view, to make sure that modifications like this are preserved for successive plugin-executions. #maven
Jerome, Would it be possible to add a parameter to @requiresDependencyResolution, that determines what happens to transitive dependencies in a forked lifecycle? This could default to the current behavior, thereby preserving backwards compatibility yet allow plugins to define the strategy they require. Or, are there any other work-arounds the maven-clover2-plugin can do to prevent this? Cheers, Bump - has there been any decision as to the best way to move forward? This issue is rather limiting to Clover and any other plugins which create classified artifacts. |
||||||||||||||||||||||||||||||||||||||||||||
a simple test project that contains a log produced after patching maven and cloved plugin with the hack .
Notice how the expected-mvn.log contains:
[INFO] Building war: /tmp/clover-war-hello-world-trunk/webapp/target/clover/sayHello-1.0-clover.war
[DEBUG] adding directory META-INF/
[...]
[DEBUG] adding entry WEB-INF/lib/a-1.0-clover.jar
[DEBUG] adding entry WEB-INF/lib/clover-2.1.0.jar
[DEBUG] adding entry WEB-INF/lib/b-1.0-clover.jar
while maven will today include b-1.0-clover.jar and a-1.0.jar