Issue Type: Bug Bug
Affects Versions: 2.2
Assignee: Simon Brandhof
Attachments: sonar-jacoco-workingdir.zip
Created: 29/Nov/13 7:01 AM
Description:

When for the surefire plugin a workingDirectoy is configured the JaCoCo coverage reporting does not work. A common scenario is to set the surefire directory to the build folder (target) so artifacts created in the test phase stay within the build folder structure.

Scenario:
1) Surefire workingDirectory is set to [basedir]/target
2) Sonar configures the JaCoCo agent to use target/jacoco.exe:

  [INFO] JaCoCo agent (version 0.6.3.201306030806) extracted: /tmp/jacocoagent.jar
  [INFO] JVM options: -javaagent:/tmp/jacocoagent.jar=destfile=target/jacoco.exec,excludes=*_javassist_*

3) jacoco.exec is created as target/target/jacoco.exec
4) Sensor tries to read target/jacoco.exe

[INFO] Sensor JaCoCoSensor...
[INFO] Project coverage is set to 0% as no JaCoCo execution data has been dumped: target/jacoco.exec

When running jacoco:prepare-agent jacoco:report it works as expected, the agent is configured with a absolute path and not using the surefire workingDirectory

[INFO] --- jacoco-maven-plugin:0.6.3.201306030806:prepare-agent (default-cli) @ jacocoWorkingDirTest ---
[INFO] argLine set to "-javaagent:/home/user/org.jacoco.agent-0.6.3.201306030806-runtime.jar=destfile=/home/user/project/target/jacoco.exec"
Project: Mojo's Sonar Maven Plugin
Priority: Major Major
Reporter: AJ Banck
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to