-
Bug
-
Resolution: Unsolved Mysteries
-
Medium
-
2.3.2
-
None
-
jdk 1.5, Maven 2.0.9
My tests were working fine when not using Clover. As soon as I added the clover goals to Maven (clover2:instrument clover2:aggregate clover2:clover) my tests started to fail. I looked at the surefire.test.class.path property and it had all of the jars I had excluded. All of the dependencies and transitive dependencies of org.apache.cxf cxf-bundle showed up in the surefire classpath. When NOT using Clover the surefire classpath did NOT have these jars included in it.
<dependency>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle</artifactId>
</exclusion>
</exclusions>
</dependency>
I might have tracked down the bug...in CloverInstrumentInternalMojo.java.
It looks like the dependencies are grabbed from the project to build the compile classpath without regard for exclusions...
Set set = new HashSet( getProject().getDependencyArtifacts() );
private void addCloverDependencyToCompileClasspath()
throws MojoExecutionException
{
Artifact cloverArtifact = findCloverArtifact( this.pluginArtifacts );
if ( cloverArtifact == null )
cloverArtifact = artifactFactory.createArtifact( cloverArtifact.getGroupId(), cloverArtifact.getArtifactId(),
cloverArtifact.getVersion(), Artifact.SCOPE_COMPILE, cloverArtifact.getType() );
// TODO: use addArtifacts when it's implemented, see http://jira.codehaus.org/browse/MNG-2197
Set set = new HashSet( getProject().getDependencyArtifacts() );
set.add( cloverArtifact );
getProject().setDependencyArtifacts( set );
}
[CLOV-310] Plugin Ignoring Dependency Exclusions building surefire.test.class.path
Workflow | Original: New Clover Workflow [ 896690 ] | New: New Clover Workflow - Restricted [ 1474059 ] |
Workflow | Original: Clover Workflow [ 895096 ] | New: New Clover Workflow [ 896690 ] |
Workflow | Original: reviewflow [ 131438 ] | New: Clover Workflow [ 895096 ] |
Fix Version/s | Original: 2.4 [ 13971 ] | |
Fix Version/s | New: won't fix [ 38394 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Resolution | New: Unsolved Mysteries [ 13 ] | |
Status | Original: Needs Verification [ 10004 ] | New: Resolved [ 5 ] |
I have no doubt that this was indeed a problem - however will close for now, until we can get reproduce this consistently.
Possibly an upgrade from maven 2.0.8 to maven 2.0.9 fixed this problem.