Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9757

Cobertura plugin fails maven builds unless workspace is whiped

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • cobertura-plugin
    • None
    • Solaris 10, Apache Tomcat Version 6.0.29, jdk1.6.0_21, Jenkins 1.409, Jenkins Cobertura Plugin 1.2, Maven 3, Maven Cobertura 2.5

      The Jenkins Cobertura plugin will always fail a Maven build if the workspace is not whiped out prior to the build taking place. Ant builds do not seem to have this behavior. In my Jenkins server, I have both Ant and Maven builds that use the Cobertura Jenkins plugin. The Ant builds work fine every time. The maven builds will ALWAYS fail from the Cobertura plugin if the workspace is not wiped out prior to the maven build running. The Cobertura Maven plugin DOES successfully create a report. Yet the Jenkins Cobertura plugin always thinks the build has failed if the workspace has not been wiped, and then fails to publish the report. See below Maven output (sanitized):
      Started by an SCM change
      Updating XXX
      U pom.xml
      At revision 73
      Found mavenVersion 3.0.2 from file jar:file:/buildtools/hudson/tools/maven-3.0.2/lib/maven-core-3.0.2.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
      Parsing POMs
      [workspace] $ /buildtools/binaries/jdk1.6.0_21/bin/java -cp /buildtools/hudson/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.1.jar:/buildtools/hudson/tools/maven-3.0.2/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /buildtools/hudson/tools/maven-3.0.2 /buildtools/tomcat/webapps/hudson/WEB-INF/lib/remoting-1.409.jar /buildtools/hudson/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.1.jar 64028
      <===[HUDSON REMOTING CAPACITY]===>channel started
      Executing Maven: -B -f /buildtools/hudson/jobs/XXX/workspace/pom.xml package
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building XXX 2.11.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:resources (default-resources) @ XXX —
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:compile (default-compile) @ XXX —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:testResources (default-testResources) @ XXX —
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ XXX —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — maven-surefire-plugin:2.7.1:test (default-test) @ XXX —
      [INFO] Surefire report directory: /buildtools/hudson/jobs/XXX/workspace/target/surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      There are no tests to run.

      Results :

      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

      [JENKINS] Recording test results
      [INFO]
      [INFO] — maven-jar-plugin:2.3.1:jar (default-jar) @ XXX —
      [INFO] Building jar: /buildtools/hudson/jobs/XXX/workspace/target/XXX-2.11.0-SNAPSHOT.jar
      mojo forkStarted org.codehaus.mojo:cobertura-maven-plugin:2.5(default)
      [JENKINS] cobertura-maven-plugin already configured with xml reports enabled
      forkedProjectStarted XXX2.11.0-SNAPSHOT
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:resources (default-resources) @ XXX —
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:compile (default-compile) @ XXX —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — cobertura-maven-plugin:2.5:instrument (default) @ XXX —
      [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
      Cobertura: Loaded information on 61 classes.
      Instrumenting 4 files to /buildtools/hudson/jobs/XXX/workspace/target/generated-classes/cobertura
      Cobertura: Saved information on 61 classes.
      Instrument time: 2185ms

      [INFO] Instrumentation was successful.
      [INFO] NOT adding cobertura ser file to attached artifacts list.
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:testResources (default-testResources) @ XXX —
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ XXX —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — maven-surefire-plugin:2.7.1:test (default-test) @ XXX —
      [INFO] Surefire report directory: /buildtools/hudson/jobs/XXX/workspace/target/surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      There are no tests to run.

      Results :

      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

      [JENKINS] Recording test results
      forkedProjectSucceeded XXX2.11.0-SNAPSHOT
      [JENKINS] Archiving /buildtools/hudson/jobs/XXX/workspace/pom.xml to /buildtools/hudson/jobs/XXX/modules/XXX$XXX/builds/2011-05-24_13-05-37/archive/XXX/XXX/2.11.0-SNAPSHOT/XXX-2.11.0-SNAPSHOT.pom
      mojo forkSucceeded org.codehaus.mojo:cobertura-maven-plugin:2.5(default)
      [JENKINS] Recording coverage results
      [JENKINS] cobertura-maven-plugin already configured with xml reports enabled
      [INFO]
      [INFO] — cobertura-maven-plugin:2.5:cobertura (default) @ XXX —
      [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
      Cobertura: Loaded information on 61 classes.
      Report time: 8726ms

      [INFO] Cobertura Report generation was successful.
      [JENKINS] Recording coverage results
      [JENKINS] Unable to add link to cobertura results
      projectSucceeded com.cccis.valuation.mvi.core:XXX:2.11.0-SNAPSHOT
      [JENKINS] Archiving /buildtools/hudson/jobs/XXX/workspace/target/XXX-2.11.0-SNAPSHOT.jar to /buildtools/hudson/jobs/XXX/modules/XXX$XXX/builds/2011-05-24_13-05-37/archive/XXX/XXX/2.11.0-SNAPSHOT/XXX-2.11.0-SNAPSHOT.jar
      sessionEnded
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 29.540s
      [INFO] Finished at: Tue May 24 13:06:14 CDT 2011
      [INFO] Final Memory: 11M/164M
      [INFO] ------------------------------------------------------------------------
      Sending e-mails to: XXX
      channel stopped
      Skipping Cobertura coverage report as build was not UNSTABLE or better ...
      Sending e-mails to: XXX
      Finished: SUCCESS

      Below is the Maven pom.xml (sanitized):
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>XXX</groupId>
      <artifactId>XXX</artifactId>
      <version>2.11.0-SNAPSHOT</version>
      <packaging>jar</packaging>
      <name>XXX</name>
      <description>XXX</description>
      <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
      <build>
      <plugins>
      <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>cobertura-maven-plugin</artifactId>
      <version>2.5</version>
      <configuration>
      <encoding>UTF-8</encoding>
      <formats>
      <format>xml</format>
      </formats>
      <instrumentation>
      <ignores>
      <ignore>XXX.*</ignore>
      </ignores>
      <excludes>
      <exclude>XXX/*.class</exclude>
      </excludes>
      </instrumentation>
      <check>
      <haltOnFailure>false</haltOnFailure>
      <branchRate>0</branchRate>
      <lineRate>0</lineRate>
      <totalBranchRate>0</totalBranchRate>
      <totalLineRate>0</totalLineRate>
      <packageLineRate>0</packageLineRate>
      <packageBranchRate>0</packageBranchRate>
      <regexes>
      <regex>
      <pattern>XXX.*</pattern>
      <branchRate>0</branchRate>
      <lineRate>0</lineRate>
      </regex>
      </regexes>
      </check>
      </configuration>
      <executions>
      <execution>
      <phase>package</phase>
      <goals>
      <goal>cobertura</goal>
      </goals>
      </execution>
      </executions>
      </plugin>
      </plugins>
      </build>
      <dependencies>
      <dependency>
      <groupId>com.oracle.jars.webservices.lib</groupId>
      <artifactId>jaxrpc-api</artifactId>
      <version>10.1.3.5</version>
      <type>jar</type>
      <scope>compile</scope>
      </dependency>
      <dependency>
      <groupId>com.oracle.jars.webservices.lib</groupId>
      <artifactId>wsclient</artifactId>
      <version>10.1.3.5</version>
      <type>jar</type>
      <scope>compile</scope>
      </dependency>
      <dependency>
      <groupId>com.oracle.jars.webservices.lib</groupId>
      <artifactId>soap</artifactId>
      <version>11.1.1.3.0</version>
      <type>jar</type>
      <scope>compile</scope>
      </dependency>
      <dependency>
      <groupId>XXX</groupId>
      <artifactId>XXX</artifactId>
      <version>2.11.0-SNAPSHOT</version>
      <scope>compile</scope>
      </dependency>
      </dependencies>
      <distributionManagement>
      <repository>
      <id>releases</id>
      <name>Releases</name>
      <url>http://XXX/content/repositories/releases/</url>
      </repository>
      <snapshotRepository>
      <id>snapshots</id>
      <name>Snapshots</name>
      <url>http://XXX/content/repositories/snapshots/</url>
      </snapshotRepository>
      </distributionManagement>
      </project>

      If the workspace is wiped out prior to the build, I get the following output (sanitized):
      Started by user XXX
      Updating http://XXX
      At revision 64
      no change for http://XXX
      Found mavenVersion 3.0.2 from file jar:file:/buildtools/hudson/tools/maven-3.0.2/lib/maven-core-3.0.2.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
      Parsing POMs
      [workspace] $ /buildtools/binaries/jdk1.6.0_21/bin/java -cp /buildtools/hudson/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.1.jar:/buildtools/hudson/tools/maven-3.0.2/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /buildtools/hudson/tools/maven-3.0.2 /buildtools/tomcat/webapps/hudson/WEB-INF/lib/remoting-1.409.jar /buildtools/hudson/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.1.jar 49846
      <===[HUDSON REMOTING CAPACITY]===>channel started
      Executing Maven: -B -f /buildtools/hudson/jobs/XXX/workspace/pom.xml package
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building XXX 2.11.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:resources (default-resources) @ XXX —
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:compile (default-compile) @ XXX —
      [INFO] Compiling 61 source files to /buildtools/hudson/jobs/XXX/workspace/target/classes
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:testResources (default-testResources) @ XXX —
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ XXX —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — maven-surefire-plugin:2.7.1:test (default-test) @ XXX —
      [INFO] Surefire report directory: /buildtools/hudson/jobs/XXX/workspace/target/surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      There are no tests to run.

      Results :

      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

      [JENKINS] Recording test results
      [INFO]
      [INFO] — maven-jar-plugin:2.3.1:jar (default-jar) @ XXX —
      [INFO] Building jar: /buildtools/hudson/jobs/XXX/workspace/target/XXX-2.11.0-SNAPSHOT.jar
      mojo forkStarted org.codehaus.mojo:cobertura-maven-plugin:2.5(default)
      [JENKINS] cobertura-maven-plugin already configured with xml reports enabled
      forkedProjectStarted XXX:XXX.11.0-SNAPSHOT
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:resources (default-resources) @ XXX —
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:compile (default-compile) @ XXX —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — cobertura-maven-plugin:2.5:instrument (default) @ XXX —
      [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
      Instrumenting 61 files to /buildtools/hudson/jobs/XXX/workspace/target/generated-classes/cobertura
      Cobertura: Saved information on 61 classes.
      Instrument time: 3242ms

      [INFO] Instrumentation was successful.
      [INFO] NOT adding cobertura ser file to attached artifacts list.
      [INFO]
      [INFO] — maven-resources-plugin:2.4.3:testResources (default-testResources) @ XXX —
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] — maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ XXX —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — maven-surefire-plugin:2.7.1:test (default-test) @ XXX —
      [INFO] Surefire report directory: /buildtools/hudson/jobs/XXX/workspace/target/surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      There are no tests to run.

      Results :

      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

      [JENKINS] Recording test results
      forkedProjectSucceeded XXX2.11.0-SNAPSHOT
      [JENKINS] Archiving /buildtools/hudson/jobs/XXX/workspace/pom.xml to /buildtools/hudson/jobs/XXX/modules/XXX$XXX/builds/2011-05-24_10-45-01/archive/XXX/XXX/2.11.0-SNAPSHOT/XXX-2.11.0-SNAPSHOT.pom
      mojo forkSucceeded org.codehaus.mojo:cobertura-maven-plugin:2.5(default)
      [JENKINS] cobertura-maven-plugin already configured with xml reports enabled
      [INFO]
      [INFO] — cobertura-maven-plugin:2.5:cobertura (default) @ XXX —
      [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
      Cobertura: Loaded information on 61 classes.
      Report time: 9847ms

      [INFO] Cobertura Report generation was successful.
      [JENKINS] Recording coverage results
      projectSucceeded XXX:2.11.0-SNAPSHOT
      [JENKINS] Archiving /buildtools/hudson/jobs/XXX/workspace/target/XXX-2.11.0-SNAPSHOT.jar to /buildtools/hudson/jobs/XXX/modules/XXX$XXX/builds/2011-05-24_10-45-01/archive/XXX/XXX/2.11.0-SNAPSHOT/XXX-2.11.0-SNAPSHOT.jar
      sessionEnded
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 35.413s
      [INFO] Finished at: Tue May 24 10:45:44 CDT 2011
      [INFO] Final Memory: 14M/136M
      [INFO] ------------------------------------------------------------------------
      channel stopped
      Publishing Cobertura coverage report...
      Publishing Cobertura coverage results...
      Sending e-mails to: XXX
      Finished: SUCCESS

            Unassigned Unassigned
            trigertas Todd Rigertas
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: