SLING-9703 Enable code coverage with JaCoCo
diff --git a/pom.xml b/pom.xml
index 2b2b113..363e19d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,10 +77,36 @@
<name>bundle.filename</name>
<value>${basedir}/target/${project.build.finalName}.jar</value>
</property>
+ <property>
+ <name>jacoco.command</name>
+ <value>${jacoco.command}</value>
+ </property>
</systemProperties>
</configuration>
</plugin>
<plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent</id>
+ <configuration>
+ <propertyName>jacoco.command</propertyName>
+ </configuration>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>report</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
</plugin>
diff --git a/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java b/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java
index 9595edd..1dcf337 100644
--- a/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java
+++ b/src/test/java/org/apache/sling/scripting/thymeleaf/it/tests/ThymeleafTestSupport.java
@@ -47,6 +47,7 @@
import static org.ops4j.pax.exam.CoreOptions.junitBundles;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.vmOption;
public abstract class ThymeleafTestSupport extends TestSupport {
@@ -87,7 +88,8 @@
// testing
mavenBundle().groupId("org.jsoup").artifactId("jsoup").versionAsInProject(),
mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(),
- junitBundles()
+ junitBundles(),
+ vmOption(System.getProperty("jacoco.command"))
);
}