Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-310

Plugin Ignoring Dependency Exclusions building surefire.test.class.path

    • Icon: Bug Bug
    • Resolution: Unsolved Mysteries
    • Icon: Medium Medium
    • won't fix
    • 2.3.2
    • Maven plugin
    • 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 )

      { throw new MojoExecutionException( "Couldn't find com.cenqua.clover:clover artifact in plugin dependencies" ); }

      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

            No work has yet been logged on this issue.

              npellow Nick
              f18625d9893d Franz Garsombke
              Affected customers:
              1 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: