Hudson Builds Failure With NoClassDefFoundError When Generating Cobertura Coverage Report

I'm having a problem generating a Cobertura report with Hudson and Maven and I hope someone here can have a solution.

I can see that cobertura artifacts are generated when hudson builds my project. But when I configure my hudson project to publish the Cobertura coverage report, I see that the build fails with the following error:

Publishing Cobertura coverage report ...
Publishing Cobertura coverage results ...
FATAL: org/jfree/chart/axis/CategoryAxis
java.lang.NoClassDefFoundError: org/jfree/chart/axis/CategoryAxis
  at hudson.plugins.cobertura.CoberturaXmlHandler.startDocument(...)

      

The build result shows that Java version is 1.6.0_38

If I have configured my project so that no Cobertura coverage report is generated then the build is successful.

The following plugins are installed on hudson:

  • Findbugs (version 4.41-h-2)
  • Checkstyle (version 3.28-h-1)
  • Cobertura (version 1-6-h-1)
  • Static Analysis Collector (version 1.28-h-1)
  • Static analysis utilities (version 1.42-h-1)
  • Maven 3 Build (version 3.0.0)

The following maven command is used:

  • clean install findbugs: findbugs checkstyle: checkstyle cobertura: cobertura

Any suggestions on how to fix this issue?

+3


source to share


1 answer


You need to install the JFreeChart plugin needed to generate charts in cobertura (why the class didn't find an exception when starting cobertura), but it has been removed from the main hudson distribution:

(JFreeChart ...) Moved to external plugin. Available from the Alpha version. Any external plugins using JFreechart will need to add a dependency on this external plugin to ensure compatibility. For future charting needs, BIRT Charts are now included as a core plugin



EDIT: There's a bug in the transitive dependency as shown here . Install version cobertura-plugin 1.6-h-3. mvn

+1


source







All Articles