coveralls-maven-plugin icon indicating copy to clipboard operation
coveralls-maven-plugin copied to clipboard

coverage report file not found

Open bluestreak01 opened this issue 10 years ago • 7 comments

I have a setup with parent pom.xml with no source and modules with coverage files. Plugin fails to find coverage files with this error:

mvn clean cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report

[ERROR] Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:3.0.0:report (default-cli) on project nfsdb: I/O operation failed: No coverage report files found -> [Help 1]

bluestreak01 avatar Oct 12 '14 03:10 bluestreak01

Make sure you have configured Cobertura correctly. You need to use XML format in the reports:

  <configuration>
    <format>xml</format>
    <aggregate>true</aggregate>
  </configuration>

The aggregate property is not mandatory, but suggested for multi module projects. That way you delegate the report aggregation for the coverage tool.

By default the Cobertura reports are looked from .../module1/target/site/cobertura/coverage.xml and similar directories. Make sure after running cobertura:cobertura you have such files generated. If aggregate is set for Cobertura, the coverage report is expected to be located relative to the root project target/site/cobertura/coverage.xml.

trautonen avatar Oct 12 '14 10:10 trautonen

Thank you for prompt reply. My parent pom.xml looks like this:

            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <sourceEncoding>UTF8</sourceEncoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <check>true</check>
                    <format>xml</format>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>

Unfortunately the error remains the same.

bluestreak01 avatar Oct 12 '14 19:10 bluestreak01

The configuration looks fine. Are you running Cobertura with Java 8? If so, no results are expected, because Cobertura fails with Java 8. You can only change to JaCoCo's latest version, which supports Java 8.

trautonen avatar Oct 12 '14 20:10 trautonen

I use Java 7, have not tried Java 8 yet.

bluestreak01 avatar Oct 12 '14 20:10 bluestreak01

Java version is ruled out then. You should run your maven build with -X flag for debugging and look for lines like:

[cobertura] DEBUG [main] net.sourceforge.cobertura.reporting.Main - format is xml encoding is UTF-8
[cobertura] DEBUG [main] net.sourceforge.cobertura.reporting.Main - dataFile is .../sample/target/cobertura/cobertura.ser
[cobertura] DEBUG [main] net.sourceforge.cobertura.reporting.Main - destinationDir is .../sample/target/site/cobertura

INFO: Cobertura: Loaded information on 5 classes.

[INFO] Cobertura Report generation was successful.

And if you are running local build, verify that the coverage.xml files are found under the target.

trautonen avatar Oct 12 '14 20:10 trautonen

Cobertura runs, but no coverage.xml is generated. I'm not sure why. This is probably the cause for coveralls failure. I'll have to park this for next few days, thank you for your help!

bluestreak01 avatar Oct 12 '14 21:10 bluestreak01

Maybe this can be useful... I had exactly the same issue with Cobertura and a multi-module project with the parent having no test. For me, the error was that I set my <plugin> definitions in the parent pom under <reporting> (as for the javadoc plugin) instead of <build>. With Cobertura and the coveralls plugin correctly configured under , it worked fine.

kermitt2 avatar May 03 '15 18:05 kermitt2