Reputation: 344
I'm trying to get my jacoco report in Teamcity. Jacoco runs without any problem with jacoco maven plugin and generates correct report. I try to get it with the Teamcity service message. I created a separate step immediately after "clean package" step. There I send a message like it is suggested in Teamcity documentation.
I do it like this
echo "##teamcity[jacocoReport dataPath='target/jacoco.exec' includes='zwc.*']"
zwc is my root package
Also I publish jacoco.exec as an artifact. This way I can verify its correct.
BUT Here I have a problem. In the log I constantly see
[11:58:27] [Step 5/9] Generating JaCoCo coverage...
[11:58:28] [Generating JaCoCo coverage...] JaCoCo report generating finished
[11:58:28] [Step 5/9] Publishing JaCoCo coverage...
[11:58:28] [Publishing JaCoCo coverage...] Coverage was not collected properly. Check your JaCoCo configuration.
Unfortunately Teamcity doesn't give any information what went wrong and which configuration is incorrect. In pom or in this service message.
Any help would be appreciated.
Upvotes: 0
Views: 1362
Reputation: 83
Normally TeamCity creates a logfile /.teamcity/coverage/jacoco/jacoco.log
in the hidden build artifacts. In many cases the reason is e.g. a wrong filtering or wrong pattern, which can be recognized by the statement:
total 0 classfiles processed, 0 analyzed
You may need to add a classpath search pattern like it is described in TeamCity Documentation. For example: +:target/main/java/**
Or you can try to check your includes in general (eg. if it really matches what you want to include or if there is a spelling mistake or something like that).
Upvotes: 3