Skip to content

Commit f9e5ea0

Browse files
committed
Fixed coverage reporting in sonar - instrumentation should now also work correctly for maven package
1 parent a8e0355 commit f9e5ea0

File tree

1 file changed

+12
-2
lines changed
  • samples/maven/combined-scala-java-multi-module-sonar

1 file changed

+12
-2
lines changed

samples/maven/combined-scala-java-multi-module-sonar/pom.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
<properties>
1616
<scala.version>2.11.6</scala.version>
17+
<sbt.version>0.13.8</sbt.version>
1718
<!--Sonar-->
1819
<sonar.core.codeCoveragePlugin>scoverage</sonar.core.codeCoveragePlugin>
1920
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
2021
<sonar.junit.reportsPath>target/surefire-reports</sonar.junit.reportsPath>
2122
<sonar.scoverage.reportPath>target/scoverage.xml</sonar.scoverage.reportPath>
22-
<sonar.scala.cobertura.reportPath>target/notthere.xml</sonar.scala.cobertura.reportPath>
2323
<sonar.sources>src</sonar.sources>
2424
<sonar.jacoco.reportPath>target/jacoco.exec</sonar.jacoco.reportPath>
2525
<sonar.exclusions>src/test/**</sonar.exclusions>
@@ -76,10 +76,20 @@
7676
<highlighting>true</highlighting>
7777
</configuration>
7878
<executions>
79+
<execution>
80+
<id>instrument</id>
81+
<goals>
82+
<!-- used to add instrumentation -->
83+
<goal>pre-compile</goal>
84+
<!-- used to remove instrumentation for testCompile -->
85+
<goal>post-compile</goal>
86+
</goals>
87+
</execution>
7988
<execution>
8089
<id>scoverage-report</id>
8190
<goals>
82-
<goal>report</goal>
91+
<!-- Needed for Sonar -->
92+
<goal>report-only</goal>
8393
</goals>
8494
<phase>prepare-package</phase>
8595
</execution>

0 commit comments

Comments
 (0)