Experiment: aggregate jacoco for sonar
[yangtools.git] / yang / rfc8040-parser-support / pom.xml
index cb86373ec52f5f6b3f6f548ab7815cb496a73d69..5505342b7aa55f8ba2f4ce0aef577e440029cda6 100644 (file)
     <name>${project.artifactId}</name>
     <description>RFC8040 parser support</description>
 
+    <properties>
+        <sonar.jacoco.reportPath>${project.base.directory}/../../target/jacoco.exec</sonar.jacoco.reportPath>
+    </properties>
+
     <dependencyManagement>
         <dependencies>
             <dependency>
                     <failOnError>true</failOnError>
                 </configuration>
            </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>pre-unit-test</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                        <configuration>
+                            <destFile>${project.build.directory}/code-coverage/jacoco.exec</destFile>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>post-unit-test</id>
+                        <goals>
+                            <goal>report</goal>
+                        </goals>
+                        <configuration>
+                            <dataFile>${project.build.directory}/code-coverage/jacoco.exec</dataFile>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>