trautonen / coveralls-maven-plugin

Maven plugin for submitting Java code coverage reports to Coveralls web service.
MIT License
312 stars 123 forks source link

JaCoCo report not found when not in default location #60

Closed mwanji closed 9 years ago

mwanji commented 9 years ago

In my pom.xml, I set JaCoCo reports to be generated in a custom location:

<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.7.2.201409121644</version>
  <configuration>
    <outputDirectory>${project.reporting.outputDirectory}/${project.version}/jacoco</outputDirectory>
  </configuration>
</plugin>

I also configured coveralls-maven-plugin to add the report in the same custom location:

<plugin>
  <groupId>org.eluder.coveralls</groupId>
  <artifactId>coveralls-maven-plugin</artifactId>
  <version>3.0.1</version>
  <configuration>
    <jacocoReports>
      <param>${project.reporting.outputDirectory}/${project.version}/jacoco</param>
    </jacocoReports>
  </configuration>
</plugin>

I get the following error:

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

I am working around it by generating the JaCoCo report in the default location, but it would be great if non-default locations worked, too.

chrisbennight commented 9 years ago

I'm seeing the same issue; had to move the output directory back to the default location despite setting it in the configuration.

chrisbennight commented 9 years ago

@mwanji

Got mine working, based on the code just looks like we needed to fully reference the jacoco.xml file, not just the base directory

trautonen commented 9 years ago

A bit late answer but as @chrisbennight said you need to reference the actual report file, not just directory. This is because some tools actually provide reports that are compatible with for example cobertura format. So you can use tools like scoverage but actually use them as cobertura reports.

I'll improve the documentation for this part. @mwanji could you try adding the full path to the jacoco.xml file and try again.

mwanji commented 9 years ago

I made the change and it works. Thanks for the help, @chrisbennight and @trautonen .