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

Surefire classpath is incorrect when depending on a jar and a test-jar from the same maven module

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Medium Medium
    • open-source
    • 2.3.2
    • Maven plugin
    • None
    • Severity 2 - Major

      We have two different applications that have the same symptom. Their test cases work properly when executed without clover, but when we run them with clover, they fail because classes or resource files are missing from the classpath.

      When running the builds with clover, the test cases are executed multiple times. Only the last time they run they fail. When checking the maven debug output (using the -X option), I found that the last time the test cases are run, a JAR file is missing from the classpath. With both applications it is a jar file from a maven module for which we both depend on the jar and test-jar types of the module.

      For example we have the following in the pom.xml file:

      <dependency>
      <groupId>${parent.groupId}</groupId>
      <artifactId>server-data-access</artifactId>
      <version>${version}</version>
      <type>test-jar</type>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>${parent.groupId}</groupId>
      <artifactId>server-data-access</artifactId>
      <version>${version}</version>
      </dependency>

      And for some reason, when the test cases are executed for the last time, the following second dependency is not included in the list of jars in the classpath.

      I have attached the pom.xml files from the module for which the test cases fail (server-web.pom), the pom.xml files from its parents, the pom.xml file for the module that generates both a jar and a test-jar (server-data-access.pom) and the log file that I get when running maven with the -X option.

      This is the classpath when the test cases fail (notice that /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-data-access/target/server-data-access-1.0.2-SNAPSHOT.jar is missing):
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-web/target/test-classes
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-web/target/classes
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-model/target/server-model-1.0.2-SNAPSHOT.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-actions/target/server-actions-1.0.2-SNAPSHOT.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/log4j/log4j/1.2.13/log4j-1.2.13.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/util/8.19.0/util-8.19.0.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/tk-util/8.19.0/tk-util-8.19.0.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/jboss/netty/netty/3.0.0.GA/netty-3.0.0.GA.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/springframework/spring/2.5.6/spring-2.5.6.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-core/target/server-core-1.0.2-SNAPSHOT.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-data-access/target/server-data-access-1.0.2-SNAPSHOT-tests.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate-annotations/3.3.0.ga/hibernate-annotations-3.3.0.ga.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate-commons-annotations/3.3.0.ga/hibernate-commons-annotations-3.3.0.ga.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate-validator/3.0.0.ga/hibernate-validator-3.0.0.ga.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate-search/3.0.0.GA/hibernate-search-3.0.0.GA.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/apache/lucene/lucene-core/2.2.0/lucene-core-2.2.0.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/drools/drools-core/4.0.7/drools-core-4.0.7.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/mvel/mvel/1.3.1-java1.4/mvel-1.3.1-java1.4.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/javax/j2ee/1.3/j2ee-1.3.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.3/jaxb-impl-2.1.3.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/common/common-configuration/1.0.25/common-configuration-1.0.25.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/opensymphony/oscache/2.1.1/oscache-2.1.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/bml-core/8.20.0-SNAPSHOT/bml-core-8.20.0-SNAPSHOT.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/cache/8.20.0-SNAPSHOT/cache-8.20.0-SNAPSHOT.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/common/common-spring-util/1.0.25/common-spring-util-1.0.25.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/esper/esper/2.2.0/esper-2.2.0.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/antlr/antlr-runtime/3.0.1/antlr-runtime-3.0.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/org/antlr/stringtemplate/3.1-b1/stringtemplate-3.1-b1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/quartz/quartz/1.5.2/quartz-1.5.2.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/mockrunner/mockrunner/0.3.1/mockrunner-0.3.1.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/common/common-abstract-unit-tests/1.0.25/common-abstract-unit-tests-1.0.25-tests.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/unittest/8.20.0-SNAPSHOT/unittest-8.20.0-SNAPSHOT.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-data-access/target/server-data-access-1.0.2-SNAPSHOT-tests.jar
      build 20-Nov-2008 08:47:57 [DEBUG] /opt/bamboo/.m2/repository/com/oracle/oracle_jdbc/10.2.0.2.0/oracle_jdbc-10.2.0.2.0.jar

      This is the classpath for when it succeeds:
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-web/target/test-classes
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-web/target/classes
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-model/target/server-model-1.0.2-SNAPSHOT.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-actions/target/server-actions-1.0.2-SNAPSHOT.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/log4j/log4j/1.2.13/log4j-1.2.13.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/util/8.19.0/util-8.19.0.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/tk-util/8.19.0/tk-util-8.19.0.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/jboss/netty/netty/3.0.0.GA/netty-3.0.0.GA.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/springframework/spring/2.5.6/spring-2.5.6.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-core/target/server-core-1.0.2-SNAPSHOT.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-data-access/target/server-data-access-1.0.2-SNAPSHOT.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate-annotations/3.3.0.ga/hibernate-annotations-3.3.0.ga.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate-commons-annotations/3.3.0.ga/hibernate-commons-annotations-3.3.0.ga.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate-validator/3.0.0.ga/hibernate-validator-3.0.0.ga.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/hibernate/hibernate-search/3.0.0.GA/hibernate-search-3.0.0.GA.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/apache/lucene/lucene-core/2.2.0/lucene-core-2.2.0.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/drools/drools-core/4.0.7/drools-core-4.0.7.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/mvel/mvel/1.3.1-java1.4/mvel-1.3.1-java1.4.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/javax/j2ee/1.3/j2ee-1.3.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.3/jaxb-impl-2.1.3.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/common/common-configuration/1.0.25/common-configuration-1.0.25.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/opensymphony/oscache/2.1.1/oscache-2.1.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/bml-core/8.20.0-SNAPSHOT/bml-core-8.20.0-SNAPSHOT.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/cache/8.20.0-SNAPSHOT/cache-8.20.0-SNAPSHOT.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/common/common-spring-util/1.0.25/common-spring-util-1.0.25.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/esper/esper/2.2.0/esper-2.2.0.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/antlr/antlr-runtime/3.0.1/antlr-runtime-3.0.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/org/antlr/stringtemplate/3.1-b1/stringtemplate-3.1-b1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/quartz/quartz/1.5.2/quartz-1.5.2.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/mockrunner/mockrunner/0.3.1/mockrunner-0.3.1.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/common/common-abstract-unit-tests/1.0.25/common-abstract-unit-tests-1.0.25-tests.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/i4commerce/bml/unittest/8.20.0-SNAPSHOT/unittest-8.20.0-SNAPSHOT.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/Bamboo/xml-data/build-dir/MONITORING-NIGHTLY/monitoring-server/server-data-access/target/server-data-access-1.0.2-SNAPSHOT-tests.jar
      build 20-Nov-2008 08:45:07 [DEBUG] /opt/bamboo/.m2/repository/com/oracle/oracle_jdbc/10.2.0.2.0/oracle_jdbc-10.2.0.2.0.jar

        1. clovertest.tar.gz
          3 kB
        2. clovertest-mvn.log.gz
          50 kB
        3. maven-build-2.1.1.pom
          17 kB
        4. monitoring.pom
          9 kB
        5. MONITORING-NIGHTLY-18.log.zip
          1.22 MB
        6. monitoring-server.pom
          1.0 kB
        7. server-data-access.pom
          3 kB
        8. server-web.pom
          16 kB

            [CLOV-379] Surefire classpath is incorrect when depending on a jar and a test-jar from the same maven module

            Nick added a comment -

            Hi Sigurd,

            Thanks for attaching a sample project here. Please not that clovertest-test/pom.xml is referring to " <version>1.0.0-SNAPHOST</version>" instead of " <version>1.0.0-SNAPSHOT</version>" in the parent element.

            Unfortunately, I can not reproduce the problem you are having.

            I have attached the output of the command line I was running.
            I tried with mvn 2.0.8 and 2.0.9 and clover 2.4.1 and 2.4.2 .

            Cheers,
            Nick

            Nick added a comment - Hi Sigurd, Thanks for attaching a sample project here. Please not that clovertest-test/pom.xml is referring to " <version>1.0.0-SNAPHOST</version>" instead of " <version>1.0.0-SNAPSHOT</version>" in the parent element. Unfortunately, I can not reproduce the problem you are having. I have attached the output of the command line I was running. I tried with mvn 2.0.8 and 2.0.9 and clover 2.4.1 and 2.4.2 . Cheers, Nick

            Can you let us know a timeframe that someone will look into this issue? We had to remove all our test-jar dependencies so that our builds could work with clover and ended up having to copy a number of properties files and java classes across multiple maven modules to get it to work. I want to remove the code duplication before things get changed to the point it takes a lot of effort to convert everything back to the way it used to be.

            Is there something we can adjust in our pom files to avoid this issue?

            Sigurd Knippenberg added a comment - Can you let us know a timeframe that someone will look into this issue? We had to remove all our test-jar dependencies so that our builds could work with clover and ended up having to copy a number of properties files and java classes across multiple maven modules to get it to work. I want to remove the code duplication before things get changed to the point it takes a lot of effort to convert everything back to the way it used to be. Is there something we can adjust in our pom files to avoid this issue?

            I created a small project with to Maven modules that reproduces the problem. I created it as similar as possible to our current Maven pom file setup.

            It has two modules, cloverissue-dependency which creates a jar and a test-jar and cloverissue-test which has a dependency on both.

            When you run the following command, the test cases fail: mvn clean install clover2:instrument clover2:aggregate clover2:clover site -Dcoverage -Ditest deploy

            The following test case failures are reported:

            -------------------------------------------------------------------------------
            Test set: org.example.MyContainerTest
            -------------------------------------------------------------------------------
            Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.034 sec <<< FAILURE!
            testSomething(org.example.MyContainerTest) Time elapsed: 0.007 sec <<< FAILURE!
            junit.framework.AssertionFailedError: the main file was not found
            at junit.framework.Assert.fail(Assert.java:47)
            at junit.framework.Assert.assertTrue(Assert.java:20)
            at junit.framework.Assert.assertNotNull(Assert.java:220)
            at org.example.MyContainerTest.testSomething(MyContainerTest.java:13)

            -------------------------------------------------------------------------------
            Test set: org.example.MyTest
            -------------------------------------------------------------------------------
            Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec <<< FAILURE!
            testSomething(org.example.MyTest) Time elapsed: 0.003 sec <<< FAILURE!
            junit.framework.AssertionFailedError: the main file was not found
            at junit.framework.Assert.fail(Assert.java:47)
            at junit.framework.Assert.assertTrue(Assert.java:20)
            at junit.framework.Assert.assertNotNull(Assert.java:220)
            at org.example.MyTest.testSomething(MyTest.java:13)

            Curiously, it doesn't fail when you don't specify the deploy argument.

            I upgraded the test project to 2.4.1 but that did not fix the issue.

            Since I have a reproducible project, I did not rerun the original project with the changes you asked. If you still need me to do that, please let me know.

            I attached the output of the -X command (this time I ran it on my workstation, which is a Mac OS X 10.5.5). I also attached the test project.

            Sigurd Knippenberg added a comment - I created a small project with to Maven modules that reproduces the problem. I created it as similar as possible to our current Maven pom file setup. It has two modules, cloverissue-dependency which creates a jar and a test-jar and cloverissue-test which has a dependency on both. When you run the following command, the test cases fail: mvn clean install clover2:instrument clover2:aggregate clover2:clover site -Dcoverage -Ditest deploy The following test case failures are reported: ------------------------------------------------------------------------------- Test set: org.example.MyContainerTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.034 sec <<< FAILURE! testSomething(org.example.MyContainerTest) Time elapsed: 0.007 sec <<< FAILURE! junit.framework.AssertionFailedError: the main file was not found at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertNotNull(Assert.java:220) at org.example.MyContainerTest.testSomething(MyContainerTest.java:13) ------------------------------------------------------------------------------- Test set: org.example.MyTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec <<< FAILURE! testSomething(org.example.MyTest) Time elapsed: 0.003 sec <<< FAILURE! junit.framework.AssertionFailedError: the main file was not found at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertNotNull(Assert.java:220) at org.example.MyTest.testSomething(MyTest.java:13) Curiously, it doesn't fail when you don't specify the deploy argument. I upgraded the test project to 2.4.1 but that did not fix the issue. Since I have a reproducible project, I did not rerun the original project with the changes you asked. If you still need me to do that, please let me know. I attached the output of the -X command (this time I ran it on my workstation, which is a Mac OS X 10.5.5). I also attached the test project.

            Nick added a comment -

            Hi Sigurd,

            This looks rather odd.

            Cheers,
            Nick

            Nick added a comment - Hi Sigurd, This looks rather odd. Could you please run mvn -X, just on the single module for which the test is failing - this will hopefully make the problem easier to spot. If you swap the order of the two dependencies, does anything change? In debug mode, clover logs the dependencies with the heading: "before changes" and "after changes", before compilation. Could you please try upgrading to the latest release of the maven-clover2-plugin: 2.4.1 Maven 2.0.9 and Clover 2.4.1 fixes a bug where dependencies were being re-ordered - this may not be related The dependency resolution code is all done in: http://svn.atlassian.com/fisheye/browse/public/contrib/clover/maven-clover-plugin/trunk/src/main/java/com/atlassian/maven/plugin/clover/CloverInstrumentInternalMojo.java?r=24941 . are you able to provide a small, cut-down project which reproduces this bug? Cheers, Nick

              Unassigned Unassigned
              97ee5f961203 Sigurd Knippenberg
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: