-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
172 lines (165 loc) · 5.58 KB
/
pom.xml
File metadata and controls
172 lines (165 loc) · 5.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.marcuschiu</groupId>
<artifactId>jacoco-example</artifactId>
<version>0.0.7</version>
<name>JaCoCo Example</name>
<description>Demo project for Spring Boot - JaCoCo Example</description>
<properties>
<java.version>11</java.version>
<!-- can be overridden with `mvn clean test -Djacoco.skip.instrument=false` -->
<jacoco.skip.instrument>true</jacoco.skip.instrument>
<jacoco-plugin.version>0.8.3</jacoco-plugin.version>
</properties>
<!-- <dependencyManagement>-->
<!-- <dependencies>-->
<!-- <dependency>-->
<!-- <groupId>org.jacoco</groupId>-->
<!-- <artifactId>org.jacoco.agent</artifactId>-->
<!-- <classifier>runtime</classifier>-->
<!-- <scope>runtime</scope>-->
<!-- <version>${jacoco-plugin.version}</version>-->
<!-- </dependency>-->
<!-- </dependencies>-->
<!-- </dependencyManagement>-->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
<!-- TEST DEPENDENCIES -->
<!-- either have: `prepare-agent` execution or `org.jacoco.agent` dependency -->
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
<classifier>runtime</classifier>
<version>0.8.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- maven by default will run test ending with *Test.java with `mvn test` command -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!--suppress MavenModelInspection -->
<skipTests>${skip.surefire.tests}</skipTests>
<systemPropertyVariables>
<jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>
</configuration>
</plugin>
<!-- maven-failsafe-plugin runs tests ending with *IT.java with `mvn verify` command -->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-failsafe-plugin</artifactId>-->
<!-- </plugin>-->
<!-- jacoco is a code coverage plugin that outputs to /target/jacoco.exe -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-plugin.version}</version>
<executions>
<!-- either have: `prepare-agent` execution or `org.jacoco.agent` dependency -->
<!-- see: https://www.jacoco.org/jacoco/trunk/doc/prepare-agent-mojo.html -->
<!-- <execution>-->
<!-- <id>jacoco-prepare-agent</id>-->
<!-- <goals><goal>prepare-agent</goal></goals>-->
<!-- </execution>-->
<!-- Performs offline instrumentation. Note that after execution of test you
must restore original classes with help of "restore-instrumented-classes" goal -->
<execution>
<id>jacoco-instrument</id>
<goals><goal>instrument</goal></goals>
<phase>process-classes</phase> <!-- or test/package/install -->
<!-- <configuration>-->
<!-- <skip>${jacoco.skip.instrument}</skip>-->
<!-- </configuration>-->
</execution>
<!-- Restores original classes as they were before offline instrumentation -->
<execution>
<id>jacoco-restore-instrumented-classes</id>
<goals><goal>restore-instrumented-classes</goal></goals>
<phase>prepare-package</phase>
<!-- <configuration>-->
<!-- <skip>${jacoco.skip.instrument}</skip>-->
<!-- </configuration>-->
</execution>
<execution>
<id>jacoco-report</id>
<goals><goal>report</goal></goals>
<phase>test</phase>
<configuration>
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
</configuration>
</execution>
<execution>
<id>jacoco-check</id>
<goals><goal>check</goal></goals>
<phase>test</phase>
<configuration>
<rules>
<rule>
<element>CLASS</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>30%</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>