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

            Owen made changes -
            Workflow Original: New Clover Workflow [ 896690 ] New: New Clover Workflow - Restricted [ 1474059 ]
            Piotr Swiecicki made changes -
            Workflow Original: Clover Workflow [ 895096 ] New: New Clover Workflow [ 896690 ]
            Piotr Swiecicki made changes -
            Workflow Original: reviewflow [ 131438 ] New: Clover Workflow [ 895096 ]
            Marek Parfianowicz made changes -
            Fix Version/s Original: 2.4 [ 13971 ]
            Fix Version/s New: won't fix [ 38394 ]
            Marek Parfianowicz made changes -
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Nick made changes -
            Resolution New: Unsolved Mysteries [ 13 ]
            Status Original: Needs Verification [ 10004 ] New: Resolved [ 5 ]

            Nick added a comment -

            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.

            Nick added a comment - 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.

            Well...after trying for about an hour the classpaths (clover/non-clover) match up.

            My environment has changed a lot since I posted this so I don't know how it is miraculously fixed

            Maybe David can provide an example.

            Sorry.

            Franz

            Franz Garsombke added a comment - Well...after trying for about an hour the classpaths (clover/non-clover) match up. My environment has changed a lot since I posted this so I don't know how it is miraculously fixed Maybe David can provide an example. Sorry. Franz

            Well...after trying for about an hour the classpaths (clover/non-clover) match up.

            My environment has changed a lot since I posted this so I don't know how it is miraculously fixed

            Maybe David can provide an example.

            Sorry.

            Franz

            Franz Garsombke added a comment - Well...after trying for about an hour the classpaths (clover/non-clover) match up. My environment has changed a lot since I posted this so I don't know how it is miraculously fixed Maybe David can provide an example. Sorry. Franz

            Nick -

            I will generate this and send it off.

            Thanks for helping.

            Franz

            Franz Garsombke added a comment - Nick - I will generate this and send it off. Thanks for helping. Franz

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

                Created:
                Updated:
                Resolved: