-
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 );
}