sonarqube - Sonar does not shows up Code Coverage after build successful with Jenkins Sonar plugin -


i trying code coverage sonar , jenkins. see jenkins' sonar plugin executes junit test cases , completes build successfully. sonar not show code coverage results (always shows 0.0% code coverage) on project. sonar show "unit test success".

i using maven jenkins , sonar.

i below message in jenkins logs while executing sonar plugin:

 project coverage set 0% no jacoco execution data has been dumped: .../sonar/target/jacoco.exec 

can 1 me how correct code coverage on sonar project.

just because sonar invoked surefire correctly (and received "unit test success" message) doesn't mean jacoco instrumented code.

try executing jacoco directly. might find out why jacoco failing directly:

mvn jacoco:prepare-agent test jacoco:report

jacoco place jacoco.exec xml/html reports within target/jacoco. or fail, , you'll have better idea why.

one common problem jacoco javaagent not run if you've changed surefire argline @ all, because jacoco:prepare-agent sets argline property in scenario, conveniently ignored. can set prepare-agent's propertyname property else (like jacocoargline) , include that in argline config:

<argline>-xmx1024m ${jacocoargline}</argline>


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

java - What is the difference between String. and String.this. ? -