Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.1
-
Fix Version/s: 2.5
-
Labels:None
-
Environment:Windows XP
JDK 1.5.0_09
Maven 2.0.4
-
Number of attachments :
Description
[INFO] Generate "Cobertura Test Coverage" report.
[DEBUG] Working Directory: null
[DEBUG] Executing command line:
[DEBUG] java -cp ";C:\Documents and Settings\jhenry\.m2\repository\commons-validator\commons-validator\1.1.4\commons-validator-1.1.4.jar;C:\Documents
and Settings\jhenry\.m2\repository\cobertura\cobertura-runtime\1.8\cobertura-runtime-1.8.pom;C:\Documents and Settings\jhenry\.m2\repository\urbanophi
le\java-getopt\1.0.9\java-getopt-1.0.9.jar;C:\Documents and Settings\jhenry\.m2\repository\oro\oro\2.0.8\oro-2.0.8.jar;C:\Documents and Settings\jhenr
y\.m2\repository\doxia\doxia-core\1.0-alpha-4\doxia-core-1.0-alpha-4.jar;C:\Documents and Settings\jhenry\.m2\repository\asm\asm\2.2.1\asm-2.2.1.jar;C
:\Documents and Settings\jhenry\.m2\repository\log4j\log4j\1.2.9\log4j-1.2.9.jar;C:\Documents and Settings\jhenry\.m2\repository\cobertura\cobertura\1
.8\cobertura-1.8.jar;C:\Documents and Settings\jhenry\.m2\repository\org\apache\maven\reporting\maven-reporting-impl\2.0\maven-reporting-impl-2.0.jar;
D:\jhenry\maven-2.0.4\core\plexus-container-default-1.0-alpha-9.jar;D:\jhenry\maven-2.0.4\core\plexus-utils-1.1.jar;D:\jhenry\maven-2.0.4\lib\maven-pr
oject-2.0.4.jar;D:\jhenry\maven-2.0.4\lib\maven-reporting-api-2.0.4.jar;D:\jhenry\maven-2.0.4\lib\maven-artifact-2.0.4.jar;D:\jhenry\maven-2.0.4\lib\m
aven-plugin-api-2.0.4.jar" -Dlog4j.configuration=file:/C:/DOCUME~1/jhenry/LOCALS~1/Temp/log4j61215config.properties -Xmx64m net.sourceforge.cobertura.
reporting.Main --source D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\src\main\java --source D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\src\main\ja
va --source D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\src\main\java --destination D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\target\site\cobert
ura --datafile D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\target\cobertura\cobertura.ser --format html
[DEBUG] exit code: 1
[DEBUG] --------------------
[DEBUG] Standard output from the Cobertura task:
[DEBUG] --------------------
[INFO] Cobertura 1.8 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura] DEBUG [main] net.sourceforge.cobertura.util.FileFinder - Adding sourceDirectory=[--source]
[cobertura] DEBUG [main] net.sourceforge.cobertura.util.FileFinder - Adding sourceDirectory=[D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\src\main\ja
va]
[cobertura] DEBUG [main] net.sourceforge.cobertura.util.FileFinder - Adding sourceDirectory=[--source]
[cobertura] DEBUG [main] net.sourceforge.cobertura.util.FileFinder - Adding sourceDirectory=[D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\src\main\ja
va]
[cobertura] DEBUG [main] net.sourceforge.cobertura.util.FileFinder - Adding sourceDirectory=[--source]
[cobertura] DEBUG [main] net.sourceforge.cobertura.util.FileFinder - Adding sourceDirectory=[D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\src\main\ja
va]
[cobertura] DEBUG [main] net.sourceforge.cobertura.reporting.Main - format is html
[cobertura] DEBUG [main] net.sourceforge.cobertura.reporting.Main - dataFile is D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\target\cobertura\cobertu
ra.ser
[cobertura] DEBUG [main] net.sourceforge.cobertura.reporting.Main - destinationDir is D:\jhenry\jwebunit-1.x\jwebunit-commons-tests\target\site\cobert
ura
Cobertura: Loaded information on 24 classes.
[DEBUG] --------------------
[DEBUG] --------------------
[DEBUG] Standard error from the Cobertura task:
[DEBUG] --------------------
[ERROR] Exception in thread "main" java.lang.ClassCastException: net.sourceforge.cobertura.coveragedata.SourceFileData
at net.sourceforge.cobertura.coveragedata.PackageData.getSourceFiles(PackageData.java:112)
at net.sourceforge.cobertura.coveragedata.ProjectData.getSourceFiles(ProjectData.java:111)
at net.sourceforge.cobertura.reporting.html.HTMLReport.generateSourceFileList(HTMLReport.java:173)
at net.sourceforge.cobertura.reporting.html.HTMLReport.generateSourceFileLists(HTMLReport.java:156)
at net.sourceforge.cobertura.reporting.html.HTMLReport.<init>(HTMLReport.java:83)
at net.sourceforge.cobertura.reporting.Main.parseArguments(Main.java:100)
at net.sourceforge.cobertura.reporting.Main.main(Main.java:161)
[DEBUG] --------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error during page generation
I have the same problem. Also if the cobertura.ser file wasn't created before (e.g. after cleaning the target directory), I get this exception:
[ERROR] Cobertura: Error writing file D:\projects\istnatives\target\cobertura\cobertura.ser
java.io.FileNotFoundException: D:\projects\istnatives\target\cobertura\cobertura.ser (Das System kann den ange
gebenen Pfad nicht finden)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler.saveCoverageData(CoverageDataFileHan
dler.java:135)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:472)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:489)
The german part in there means that the file couldn't be found.
This happens with the latest version, the older one based on Cobertura 1.7 worked as it should.
In some projects there is no build error (also we are using almost the same pom in all of them), but there the line coverage is always 100% and the branch coverage is on 0%.