|
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 |
|
|
170 | 170 | <version>${maven-surefire-plugin.version}</version> |
171 | 171 | <configuration> |
172 | 172 |
|
173 | | - <skip>true</skip> |
174 | | - <skipTests>true</skipTests> |
175 | | - |
176 | 173 | <forkMode>once</forkMode> |
177 | | - <argLine>-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8</argLine> |
| 174 | + <argLine>${argLine} -Xmx1024m -Dfile.encoding=UTF-8</argLine> |
178 | 175 | <additionalClasspathElements> |
179 | 176 | <additionalClasspathElement>${basedir}/target/test-classes</additionalClasspathElement> |
180 | 177 | </additionalClasspathElements> |
181 | 178 | <includes> |
182 | 179 | <include>**/*Test.java</include> |
| 180 | + <include>**/*_Test.java</include> |
183 | 181 | </includes> |
184 | 182 | <excludes> |
185 | 183 | <exclude>**/TestBean.java</exclude> |
|
245 | 243 | <detectBuildFailures>true</detectBuildFailures> |
246 | 244 | </configuration> |
247 | 245 | </plugin> |
| 246 | + <!-- 中央仓库发布插件: 将制品发布至 Maven Central --> |
| 247 | + <!-- https://mvnrepository.com/artifact/org.sonatype.central/central-publishing-maven-plugin --> |
| 248 | + <plugin> |
| 249 | + <!-- 中央仓库发布插件: 将制品发布至 Maven Central --> |
| 250 | + <groupId>org.sonatype.central</groupId> |
| 251 | + <artifactId>central-publishing-maven-plugin</artifactId> |
| 252 | + <version>${maven-central-publishing-plugin.version}</version> |
| 253 | + <extensions>true</extensions> |
| 254 | + <configuration> |
| 255 | + <publishingServerId>central</publishingServerId> |
| 256 | + </configuration> |
| 257 | + </plugin> |
248 | 258 | </plugins> |
249 | 259 | </pluginManagement> |
250 | 260 | <plugins> |
251 | 261 |
|
252 | 262 | <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-enforcer-plugin --> |
| 263 | + |
| 264 | + <!-- 单元测试覆盖率插件: 强制要求 90% 覆盖率 --> |
| 265 | + <!-- https://mvnrepository.com/artifact/org.jacoco/jacoco-maven-plugin --> |
| 266 | + <plugin> |
| 267 | + <!-- 单元测试覆盖率插件: 强制要求 90% 覆盖率 --> |
| 268 | + <groupId>org.jacoco</groupId> |
| 269 | + <artifactId>jacoco-maven-plugin</artifactId> |
| 270 | + <version>${maven-jacoco-plugin.version}</version> |
| 271 | + <executions> |
| 272 | + <!-- 准备 jacoco agent: 注入到 surefire 启动的 JVM --> |
| 273 | + <execution> |
| 274 | + <id>prepare-agent</id> |
| 275 | + <goals> |
| 276 | + <goal>prepare-agent</goal> |
| 277 | + </goals> |
| 278 | + </execution> |
| 279 | + <!-- 生成覆盖率报告 --> |
| 280 | + <execution> |
| 281 | + <id>report</id> |
| 282 | + <phase>verify</phase> |
| 283 | + <goals> |
| 284 | + <goal>report</goal> |
| 285 | + </goals> |
| 286 | + </execution> |
| 287 | + <!-- 强制覆盖率 >= 90% --> |
| 288 | + <execution> |
| 289 | + <id>check</id> |
| 290 | + <phase>verify</phase> |
| 291 | + <goals> |
| 292 | + <goal>check</goal> |
| 293 | + </goals> |
| 294 | + <configuration> |
| 295 | + <haltOnFailure>true</haltOnFailure> |
| 296 | + <rules> |
| 297 | + <rule> |
| 298 | + <element>BUNDLE</element> |
| 299 | + <limits> |
| 300 | + <limit> |
| 301 | + <counter>LINE</counter> |
| 302 | + <value>COVEREDRATIO</value> |
| 303 | + <minimum>0.90</minimum> |
| 304 | + </limit> |
| 305 | + </limits> |
| 306 | + </rule> |
| 307 | + </rules> |
| 308 | + </configuration> |
| 309 | + </execution> |
| 310 | + </executions> |
| 311 | + </plugin> |
| 312 | + |
253 | 313 | <plugin> |
254 | 314 | <!-- 环境检查插件:代码编译前的环境检查 --> |
255 | 315 | <groupId>org.apache.maven.plugins</groupId> |
|
404 | 464 | <!-- 将制品 staging 至 OSS Sonatype Nexus --> |
405 | 465 | <groupId>org.sonatype.plugins</groupId> |
406 | 466 | <artifactId>nexus-staging-maven-plugin</artifactId> |
| 467 | + </plugin> <!-- https://mvnrepository.com/artifact/org.sonatype.central/central-publishing-maven-plugin --> |
| 468 | + <plugin> |
| 469 | + <!-- 中央仓库发布插件: 将制品发布至 Maven Central --> |
| 470 | + <groupId>org.sonatype.central</groupId> |
| 471 | + <artifactId>central-publishing-maven-plugin</artifactId> |
407 | 472 | </plugin> |
| 473 | + |
408 | 474 | </plugins> |
409 | 475 | </build> |
410 | 476 | </profile> |
|
417 | 483 | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
418 | 484 | <maven.version>3.0</maven.version> |
419 | 485 | <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version> |
| 486 | + <maven-jacoco-plugin.version>0.8.15</maven-jacoco-plugin.version> |
| 487 | + <maven-central-publishing-plugin.version>0.11.0</maven-central-publishing-plugin.version> |
420 | 488 | <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version> |
421 | 489 | <maven-release-plugin.version>2.5.3</maven-release-plugin.version> |
422 | 490 | <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version> |
|
0 commit comments