[
https://issues.apache.org/jira/browse/SUREFIRE-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17461883#comment-17461883
]
Steinar Bang commented on SUREFIRE-1630:
----------------------------------------
I had forgotten I opened this issue. I am currently running with surefire
2.22.2 and I have coverage there.
I dug into why the coverage was lost and wrote the blog post [How to get test
coverage back in sonarcloud maven
builds|https://steinar.bang.priv.no/2020/03/30/how-to-get-test-coverage-back-in-sonarcloud-maven-builds/]
in March 2020.
And in the blog post I say I lost coverage in January 2020, so either I wrote
the wrong year in the blog post, or have lost coverage twice? I think maybe I
wrote the wrong year in the blog post and that this was an issue I lived with
for over a year.
The change done in the blog post is to ensure that jacoco creates an XML
coverage file, and also aggregate all coverage in a single XML coverage in a
multi module project.
> sonarqube reports 0% coverage with maven-surefire-plugin versions later than
> 2.20
> ---------------------------------------------------------------------------------
>
> Key: SUREFIRE-1630
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1630
> Project: Maven Surefire
> Issue Type: Bug
> Affects Versions: 2.20.1, 2.21.0, 2.22.0, 2.22.1
> Environment: Debian 9.7 "stretch", amd64, openjdk-8
> 8u181-b13-2~deb9u1, maven 3.3.9-4, JUnit 5.1.0
> Reporter: Steinar Bang
> Priority: Major
> Labels: waiting-for-feedback
>
> I create sonar reports with the following command line and no sonar or jacoco
> config in my POMS:
> {noformat}
> mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar
> {noformat}
> With maven surefire plugin 2.x versions newer than 2.20 the resulting sonar
> report shows 0% test coverage.
> My workaround to get coverage back, was to downgrade to surefire 2.20.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)