Versions used:
- Sonarqube: 8.5.1.38104 (Developer Edition)
- jacoco Plugin: 1.1.0.898
- JDK + Maven: Docker image maven:3-jdk-8
- org.sonarsource.scanner.maven:sonar-maven-plugin 3.7.0.1746
- org.jacoco:jacoco-maven-plugin 0.8.5
Context:
- Coverage import from JaCoCo during Analysis of Java Projects based on Maven
- Execution environment: GitLab CI/CD
Observations:
- The positions of covered lines in the code view are offet by 1 in comparison with the report provided by JaCoCo (observation based on the HTML page provided, not on the XML)
- Computation of Coverage on New Code is therefore presumably wrong, since lines for New Code are correctly determined
Steps to reproduce:
- Assumption: Maven Project using the JaCoCo and Sonar-Scanner Plugins is available
- Verify Maven Project and safe the generated HTML report for comparison
mvn verify
- Perform SonarQube analysis
mvn -Dsonar.qualitygate.wait=true sonar:sonar
- Compare presentation of covered lines in JaCoCo HTML report and the code view in SonarQube