NotACat
NotACat

Reputation: 39

How to integrate multiple jacocoReport in teamcity?

In my command execution build step I have the below script:

`mvn test -Djacoco.percentage.instruction=0.00

echo "##teamcity[jacocoReport dataPath='projectPath/target/coverage-reports/jacoco-unit.exec' includes='com.project.test.*' sources=' projectPath/src/main/java' reportDir='projectPath/target/temp/jacocoReport']"

echo "##teamcity[jacocoReport dataPath='projectPath2/target/coverage-reports/jacoco-unit.exec' includes='com.project.test2.*' sources='projectPath2/src/main/java' reportDir='projectPath2/target/temp/jacocoReport']"`

I want two code coverage reports in the build but the second echo statement is just overwritting the first one. Is there any way to integrate multiple jacocoReport per build?

Upvotes: 0

Views: 68

Answers (1)

Alexander Pletnev
Alexander Pletnev

Reputation: 3546

As far as I remember it's not possible by design.

If the both projects are part of a multimodule project, you need to set up JaCoCo accordingly to build an aggregate report.

If you have two independent Maven projects, the idea is that you build them in separate build configurations.

Another option would be to set up JaCoCo to aggregate the results of independent scans in a single report.

Upvotes: 0

Related Questions