|
27 | 27 |
|
28 | 28 | <scm> |
29 | 29 |
|
30 | | - <connection>scm:git:https:github.com/easy-4-java/${project.artifactId}.git</connection> |
31 | | - <developerConnection>scm:git:https:github.com/easy-4-java/${project.artifactId}.git</developerConnection> |
32 | | - <url>https:github.com/easy-4-java/${project.artifactId}</url> |
| 30 | + <connection>scm:git:https://github.com/easy-4-java/${project.artifactId}.git</connection> |
| 31 | + <developerConnection>scm:git:https://github.com/easy-4-java/${project.artifactId}.git</developerConnection> |
| 32 | + <url>https://github.com/easy-4-java/${project.artifactId}</url> |
33 | 33 | <tag>${project.artifactId}</tag> |
34 | 34 | </scm> |
35 | 35 |
|
|
167 | 167 | <version>${maven-surefire-plugin.version}</version> |
168 | 168 | <configuration> |
169 | 169 |
|
170 | | - <skip>true</skip> |
171 | | - <skipTests>true</skipTests> |
172 | | - |
173 | | - |
174 | | - <argLine>-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8</argLine> |
| 170 | + <argLine>${argLine} -Xmx1024m -Dfile.encoding=UTF-8</argLine> |
175 | 171 | <additionalClasspathElements> |
176 | 172 | <additionalClasspathElement>${basedir}/target/test-classes</additionalClasspathElement> |
177 | 173 | </additionalClasspathElements> |
178 | 174 | <includes> |
179 | 175 | <include>**/*Test.java</include> |
| 176 | + <include>**/*_Test.java</include> |
180 | 177 | </includes> |
181 | 178 | <excludes> |
182 | 179 | <exclude>**/TestBean.java</exclude> |
|
239 | 236 | <detectBuildFailures>true</detectBuildFailures> |
240 | 237 | </configuration> |
241 | 238 | </plugin> |
| 239 | + <!-- 中央仓库发布插件: 将制品发布至 Maven Central --> |
| 240 | + <!-- https://mvnrepository.com/artifact/org.sonatype.central/central-publishing-maven-plugin --> |
| 241 | + <plugin> |
| 242 | + <!-- 中央仓库发布插件: 将制品发布至 Maven Central --> |
| 243 | + <groupId>org.sonatype.central</groupId> |
| 244 | + <artifactId>central-publishing-maven-plugin</artifactId> |
| 245 | + <version>${maven-central-publishing-plugin.version}</version> |
| 246 | + <extensions>true</extensions> |
| 247 | + <configuration> |
| 248 | + <publishingServerId>central</publishingServerId> |
| 249 | + </configuration> |
| 250 | + </plugin> |
242 | 251 | </plugins> |
243 | 252 | </pluginManagement> |
244 | 253 | <plugins> |
245 | 254 |
|
246 | 255 | <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-enforcer-plugin --> |
| 256 | + |
| 257 | + <!-- 单元测试覆盖率插件: 强制要求 90% 覆盖率 --> |
| 258 | + <!-- https://mvnrepository.com/artifact/org.jacoco/jacoco-maven-plugin --> |
| 259 | + <plugin> |
| 260 | + <!-- 单元测试覆盖率插件: 强制要求 90% 覆盖率 --> |
| 261 | + <groupId>org.jacoco</groupId> |
| 262 | + <artifactId>jacoco-maven-plugin</artifactId> |
| 263 | + <version>${maven-jacoco-plugin.version}</version> |
| 264 | + <executions> |
| 265 | + <!-- 准备 jacoco agent: 注入到 surefire 启动的 JVM --> |
| 266 | + <execution> |
| 267 | + <id>prepare-agent</id> |
| 268 | + <goals> |
| 269 | + <goal>prepare-agent</goal> |
| 270 | + </goals> |
| 271 | + </execution> |
| 272 | + <!-- 生成覆盖率报告 --> |
| 273 | + <execution> |
| 274 | + <id>report</id> |
| 275 | + <phase>verify</phase> |
| 276 | + <goals> |
| 277 | + <goal>report</goal> |
| 278 | + </goals> |
| 279 | + </execution> |
| 280 | + <!-- 强制覆盖率 >= 90% --> |
| 281 | + <execution> |
| 282 | + <id>check</id> |
| 283 | + <phase>verify</phase> |
| 284 | + <goals> |
| 285 | + <goal>check</goal> |
| 286 | + </goals> |
| 287 | + <configuration> |
| 288 | + <haltOnFailure>true</haltOnFailure> |
| 289 | + <rules> |
| 290 | + <rule> |
| 291 | + <element>BUNDLE</element> |
| 292 | + <limits> |
| 293 | + <limit> |
| 294 | + <counter>LINE</counter> |
| 295 | + <value>COVEREDRATIO</value> |
| 296 | + <minimum>0.90</minimum> |
| 297 | + </limit> |
| 298 | + </limits> |
| 299 | + </rule> |
| 300 | + </rules> |
| 301 | + </configuration> |
| 302 | + </execution> |
| 303 | + </executions> |
| 304 | + </plugin> |
| 305 | + |
247 | 306 | <plugin> |
248 | 307 | <!-- 环境检查插件:代码编译前的环境检查 --> |
249 | 308 | <groupId>org.apache.maven.plugins</groupId> |
|
401 | 460 | <!-- 将制品 staging 至 OSS Sonatype Nexus --> |
402 | 461 | <groupId>org.sonatype.plugins</groupId> |
403 | 462 | <artifactId>nexus-staging-maven-plugin</artifactId> |
| 463 | + </plugin> <!-- https://mvnrepository.com/artifact/org.sonatype.central/central-publishing-maven-plugin --> |
| 464 | + <plugin> |
| 465 | + <!-- 中央仓库发布插件: 将制品发布至 Maven Central --> |
| 466 | + <groupId>org.sonatype.central</groupId> |
| 467 | + <artifactId>central-publishing-maven-plugin</artifactId> |
404 | 468 | </plugin> |
| 469 | + |
405 | 470 | </plugins> |
406 | 471 | </build> |
407 | 472 | </profile> |
|
428 | 493 | <maven-help-plugin.version>3.5.0</maven-help-plugin.version> |
429 | 494 | <maven-install-plugin.version>3.1.3</maven-install-plugin.version> |
430 | 495 | <maven-invoker-plugin.version>3.8.0</maven-invoker-plugin.version> |
| 496 | + <maven-jacoco-plugin.version>0.8.15</maven-jacoco-plugin.version> |
| 497 | + <maven-central-publishing-plugin.version>0.11.0</maven-central-publishing-plugin.version> |
431 | 498 | <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version> |
432 | 499 | <maven-javadoc-plugin.version>3.8.0</maven-javadoc-plugin.version> |
433 | 500 | <maven-nexus-staging-plugin.version>1.7.0</maven-nexus-staging-plugin.version> |
|
490 | 557 | <artifactId>spring-boot-starter-test</artifactId> |
491 | 558 | <scope>test</scope> |
492 | 559 | </dependency> |
| 560 | + <!-- JUnit Vintage Engine: enables running legacy JUnit 4 tests --> |
| 561 | + <dependency> |
| 562 | + <groupId>org.junit.vintage</groupId> |
| 563 | + <artifactId>junit-vintage-engine</artifactId> |
| 564 | + <scope>test</scope> |
| 565 | + </dependency> |
493 | 566 |
|
494 | 567 | <!-- For Spring Boot Configuration Processor --> |
495 | 568 | <dependency> |
|
0 commit comments