JaCoCo changes for 8.9.9 LTS

I’m migrating SQ 7.9.3 to 8.9.9
Migration and testing went well except JaCoCo handling that was changed and now generates errors such as use JaCoCo plugin instead.

I’m very new to this - and articles online are often from earlier times. Could someone please share steps to convert and/or links on the same?

We have Maven and some Gradle builds, with code like:

         <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
        <jacoco.utReportFolder>${project.build.directory}/jacoco/test</jacoco.utReportFolder>
        <jacoco.utReportFile>${jacoco.utReportFolder}/test.exec</jacoco.utReportFile>
        <jacoco.itReportFolder>${project.build.directory}/jacoco/integrationTest</jacoco.itReportFolder>
        <jacoco.itReportFile>${jacoco.itReportFolder}/integrationTest.exec</jacoco.itReportFile>
        <junit.utReportFolder>${project.testresult.directory}/test</junit.utReportFolder>`
...      
 <sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>squid:UndocumentedApi</sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>
        <sonar.jacoco.itReportPath>${project.testresult.directory}/coverage/jacoco/jacoco-it.exec</sonar.jacoco.itReportPath>
        <sonar.jacoco.reportPath>${project.testresult.directory}/coverage/jacoco/jacoco.exec</sonar.jacoco.reportPath>
        <sonar.java.codeCoveragePlugin>jacoco</sonar.java.codeCoveragePlugin>
        <sonar.javascript.jstestdriver.reportsPath>${project.testresult.directory}/karma</sonar.javascript.jstestdriver.reportsPath>`

Thanks in advance!
Dan

Hi Dan,

Congrats on your upgrade!

I think the big difference is that instead of generating a .exec from JaCoCo, you need to generate the XML report. A Maven analysis should pick it up automatically if it’s in a “normal” place.

Regarding exactly how to wrangle your pom to generate one rather than the other is a bit beyond me (and out of scope for this community) tho.

 
HTH,
Ann

1 Like

Thanks, Ann. I hear you, I figured out that much. It would be nice to have a sample code somewhere, because in wading thru tutorials I realized most of them are older than the exec=>xml change. We are budgeting for commercially supported SQ for next year, but until then I’ll have to figure this out somehow. :slight_smile:

1 Like