|
87 | 87 | <maven.compiler.release>17</maven.compiler.release> |
88 | 88 |
|
89 | 89 | <maven.test.skip>false</maven.test.skip> |
| 90 | + <maven.ignore.testfailure>false</maven.ignore.testfailure> |
90 | 91 | <maven.deploy.skip>false</maven.deploy.skip> |
91 | 92 | <maven.compiler.version>3.11.0</maven.compiler.version> |
92 | 93 | <maven.surefire.version>3.0.0-M9</maven.surefire.version> |
|
99 | 100 | <maven.exec.version>3.1.0</maven.exec.version> |
100 | 101 | <maven.gpg.version>3.1.0</maven.gpg.version> |
101 | 102 |
|
| 103 | + <jacoco.version>0.8.11</jacoco.version> |
102 | 104 | <central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version> |
103 | 105 | <exec.maven.version>3.1.0</exec.maven.version> |
104 | 106 | <junit.version>5.14.2</junit.version> |
|
137 | 139 | <version>${junit.version}</version> |
138 | 140 | <scope>test</scope> |
139 | 141 | </dependency> |
140 | | - <!-- 保留 JUnit 4 测试 todo 删除--> |
141 | | - <!-- <dependency>--> |
142 | | - <!-- <groupId>junit</groupId>--> |
143 | | - <!-- <artifactId>junit</artifactId>--> |
144 | | - <!-- <version>4.13.2</version>--> |
145 | | - <!-- <scope>test</scope>--> |
146 | | - <!-- </dependency>--> |
147 | 142 | <dependency> |
148 | 143 | <groupId>org.jacoco</groupId> |
149 | 144 | <artifactId>org.jacoco.agent</artifactId> |
150 | | - <version>0.8.11</version> |
| 145 | + <version>${jacoco.version}</version> |
151 | 146 | <classifier>runtime</classifier> |
152 | 147 | <scope>test</scope> |
153 | 148 | </dependency> |
|
183 | 178 | <argLine> |
184 | 179 | --add-opens java.base/java.lang=ALL-UNNAMED |
185 | 180 | --add-opens java.base/java.util=ALL-UNNAMED |
| 181 | + --add-opens java.base/java.io=ALL-UNNAMED |
186 | 182 | </argLine> |
187 | 183 | <testFailureIgnore>${maven.ignore.testfailure}</testFailureIgnore> |
188 | 184 | <skipTests>false</skipTests> |
189 | | - <systemPropertyVariables> |
190 | | - <jacoco-agent.destfile>${project.build.directory}/coverage.exec |
191 | | - </jacoco-agent.destfile> |
192 | | - </systemPropertyVariables> |
193 | 185 | <reportsDirectory>../../site/junit</reportsDirectory> |
| 186 | + <useSystemClassLoader>false</useSystemClassLoader> |
| 187 | + <forkCount>1</forkCount> |
| 188 | + <reuseForks>true</reuseForks> |
194 | 189 | </configuration> |
195 | 190 | </plugin> |
196 | 191 | <plugin> |
|
256 | 251 | <plugin> |
257 | 252 | <groupId>org.jacoco</groupId> |
258 | 253 | <artifactId>jacoco-maven-plugin</artifactId> |
259 | | - <version>0.8.8</version> |
| 254 | + <version>${jacoco.version}</version> |
260 | 255 | <configuration> |
261 | 256 | <skip>false</skip> |
| 257 | + <destFile>${project.build.directory}/coverage.exec</destFile> |
| 258 | + <append>true</append> |
262 | 259 | </configuration> |
263 | 260 | <executions> |
264 | 261 | <execution> |
265 | | - <id>default-instrument</id> |
| 262 | + <id>prepare-agent</id> |
266 | 263 | <goals> |
267 | | - <goal>instrument</goal> |
268 | | - </goals> |
269 | | - </execution> |
270 | | - <execution> |
271 | | - <id>default-restore-instrumented-classes</id> |
272 | | - <goals> |
273 | | - <goal>restore-instrumented-classes</goal> |
| 264 | + <goal>prepare-agent</goal> |
274 | 265 | </goals> |
| 266 | + <configuration> |
| 267 | + <propertyName>surefireArgLine</propertyName> |
| 268 | + <destFile>${project.build.directory}/coverage.exec</destFile> |
| 269 | + </configuration> |
275 | 270 | </execution> |
276 | 271 | <execution> |
277 | 272 | <id>report</id> |
|
284 | 279 | <outputDirectory>../../site/${project.artifactId}</outputDirectory> |
285 | 280 | </configuration> |
286 | 281 | </execution> |
| 282 | + <execution> |
| 283 | + <id>aggregate</id> |
| 284 | + <phase>verify</phase> |
| 285 | + <goals> |
| 286 | + <goal>report-aggregate</goal> |
| 287 | + </goals> |
| 288 | + </execution> |
287 | 289 | </executions> |
288 | 290 | </plugin> |
289 | 291 | <plugin> |
290 | 292 | <groupId>org.codehaus.mojo</groupId> |
291 | 293 | <artifactId>exec-maven-plugin</artifactId> |
292 | 294 | <version>${exec.maven.version}</version> |
293 | 295 | </plugin> |
| 296 | + <plugin> |
| 297 | + <groupId>org.apache.maven.plugins</groupId> |
| 298 | + <artifactId>maven-failsafe-plugin</artifactId> |
| 299 | + <version>${maven.failsafe.version}</version> |
| 300 | + <configuration> |
| 301 | + <argLine> |
| 302 | + --add-opens java.base/java.lang=ALL-UNNAMED |
| 303 | + --add-opens java.base/java.util=ALL-UNNAMED |
| 304 | + </argLine> |
| 305 | + </configuration> |
| 306 | + <executions> |
| 307 | + <execution> |
| 308 | + <goals> |
| 309 | + <goal>integration-test</goal> |
| 310 | + <goal>verify</goal> |
| 311 | + </goals> |
| 312 | + </execution> |
| 313 | + </executions> |
| 314 | + </plugin> |
294 | 315 | </plugins> |
295 | 316 | </pluginManagement> |
296 | 317 |
|
|
311 | 332 | <groupId>org.jacoco</groupId> |
312 | 333 | <artifactId>jacoco-maven-plugin</artifactId> |
313 | 334 | </plugin> |
| 335 | + <plugin> |
| 336 | + <groupId>org.apache.maven.plugins</groupId> |
| 337 | + <artifactId>maven-failsafe-plugin</artifactId> |
| 338 | + </plugin> |
314 | 339 | </plugins> |
315 | 340 | </build> |
316 | 341 |
|
|
0 commit comments