diff --git a/pom.xml b/pom.xml index 2310a36ff46..e4e7f1a53d8 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,12 @@ 2.7 + 0.7.5.201505241946 + ${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar + ${project.build.directory}/jacoco.exec + -javaagent:${jacoco.path}=destfile=${jacoco.utReport} + 3.5 + @@ -271,6 +277,20 @@ com.googlecode.json-simple json-simple + + + org.jacoco + org.jacoco.agent + ${jacoco.version} + runtime + test + + + org.sonarsource.java + sonar-jacoco-listeners + ${jacoco-listeners.version} + test + @@ -305,9 +325,23 @@ maven-surefire-plugin 2.13 + + + + + + ${jacoco.utAgentConfig} **/*Tests.java + + + + + listener + org.sonar.java.jacoco.JUnitListener + + diff --git a/sonar-project.properties b/sonar-project.properties index d84ed7c2d5a..791a78523b6 100755 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,10 +4,19 @@ sonar.projectName=Simple Java project analyzed with the SonarQube Runner sonar.projectVersion=1.0 # Comma-separated paths to directories with sources (required) -sonar.sources=src +sonar.sources=src/main/java # Language sonar.language=java +# Comma-separated paths to directories with tests +sonar.tests=src/test/java + +# Comma-separated paths to directories containing the compiled bytecode files corresponding to your source files +sonar.java.binaries=target/classes + +# Tells SonarQube where the unit tests code coverage report is +sonar.jacoco.reportPath=target/jacoco.exec + # Encoding of the source files -sonar.sourceEncoding=UTF-8 \ No newline at end of file +sonar.sourceEncoding=UTF-8