Skip to content

Commit c2cd74e

Browse files
committed
add and configure JaCoCo maven plugin
In order to get a code coverage report, JaCoCo's [1] maven plugin is added an properly configured [2]. Steps to generate a code coverage report (from root of this project): ``` mvn clean verify mvn -f core/pom.xml jacoco:report ``` If the build succeeds point your browser to `core/target/site/jacoco/index.html`. [1] http://www.jacoco.org/ [2] http://www.jacoco.org/jacoco/trunk/doc/maven.html
1 parent 3db634f commit c2cd74e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

core/pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<projectpath>json-schema</projectpath>
2828
<maven.compiler.source>1.8</maven.compiler.source>
2929
<maven.compiler.target>1.8</maven.compiler.target>
30+
<jacoco.version>0.7.8</jacoco.version>
3031
</properties>
3132
<name>everit-org/json-schema</name>
3233
<url>https://github.com/everit-org/json-schema</url>
@@ -71,6 +72,30 @@
7172
</instructions>
7273
</configuration>
7374
</plugin>
75+
<plugin>
76+
<groupId>org.jacoco</groupId>
77+
<artifactId>jacoco-maven-plugin</artifactId>
78+
<version>${jacoco.version}</version>
79+
<executions>
80+
<execution>
81+
<id>default-prepare-agent</id>
82+
<goals>
83+
<goal>prepare-agent</goal>
84+
</goals>
85+
<configuration>
86+
<propertyName>surefireArgLine</propertyName>
87+
</configuration>
88+
</execution>
89+
</executions>
90+
</plugin>
91+
<plugin>
92+
<artifactId>maven-surefire-plugin</artifactId>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<version>2.19.1</version>
95+
<configuration>
96+
<argLine>${surefireArgLine}</argLine>
97+
</configuration>
98+
</plugin>
7499
</plugins>
75100
</build>
76101
<dependencies>

0 commit comments

Comments
 (0)