Skip to content

Commit ac2af5a

Browse files
committed
chore: propagate pom standardization, tests, javadoc and @author fix from 4.1.x
- Add jacoco-maven-plugin 0.8.15 with 90% coverage gate - Add central-publishing-maven-plugin 0.11.0 - Update surefire (enable tests, argLine for JaCoCo, *_Test.java pattern) - Fix SCM URLs - Copy test files from 4.1.x branch - Copy Javadoc improvements from 4.1.x branch - Standardize @author to [@loong Wan](https://github.com/loong10k) - Propagated to 3.0.x branch
1 parent bcf2ed9 commit ac2af5a

5 files changed

Lines changed: 1149 additions & 1083 deletions

File tree

pom.xml

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
<scm>
3030

31-
<connection>scm:git:https:github.com/easy-4-java/${project.artifactId}.git</connection>
32-
<developerConnection>scm:git:https:github.com/easy-4-java/${project.artifactId}.git</developerConnection>
33-
<url>https:github.com/easy-4-java/${project.artifactId}</url>
31+
<connection>scm:git:https://github.com/easy-4-java/${project.artifactId}.git</connection>
32+
<developerConnection>scm:git:https://github.com/easy-4-java/${project.artifactId}.git</developerConnection>
33+
<url>https://github.com/easy-4-java/${project.artifactId}</url>
3434
<tag>${project.artifactId}</tag>
3535
</scm>
3636

@@ -168,18 +168,17 @@
168168
<version>${maven-surefire-plugin.version}</version>
169169
<configuration>
170170
<!-- 跳过单元测试 -->
171-
<skip>true</skip>
172-
<skipTests>true</skipTests>
173171
<!-- forkMode 可设置值有 “never”, “once”, “always” 和 “pertest”。 pretest:
174172
每一个测试创建一个新进程,为每个测试创建新的JVM是单独测试的最彻底方式,但也是最慢的,不适合hudson上持续回归。 once:在一个进程中进行所有测试。once为默认设置,在Hudson上持续回归时建议使用默认设置。
175173
always:在一个进程中并行的运行脚本,Junit4.7以上版本才可以使用,surefire的版本要在2.6以上提供这个功能,其中 threadCount:执行时,指定可分配的线程数量。只和参数parallel配合使用有效。默认:5。 -->
176174
<!--<forkMode>once</forkMode>-->
177-
<argLine>-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8</argLine>
175+
<argLine>${argLine} -Xmx1024m -Dfile.encoding=UTF-8</argLine>
178176
<additionalClasspathElements>
179177
<additionalClasspathElement>${basedir}/target/test-classes</additionalClasspathElement>
180178
</additionalClasspathElements>
181179
<includes>
182180
<include>**/*Test.java</include>
181+
<include>**/*_Test.java</include>
183182
</includes>
184183
<excludes>
185184
<exclude>**/TestBean.java</exclude>
@@ -238,11 +237,70 @@
238237
<detectBuildFailures>true</detectBuildFailures>
239238
</configuration>
240239
</plugin>
240+
<!-- 中央仓库发布插件: 将制品发布至 Maven Central -->
241+
<!-- https://mvnrepository.com/artifact/org.sonatype.central/central-publishing-maven-plugin -->
242+
<plugin>
243+
<!-- 中央仓库发布插件: 将制品发布至 Maven Central -->
244+
<groupId>org.sonatype.central</groupId>
245+
<artifactId>central-publishing-maven-plugin</artifactId>
246+
<version>${maven-central-publishing-plugin.version}</version>
247+
<extensions>true</extensions>
248+
<configuration>
249+
<publishingServerId>central</publishingServerId>
250+
</configuration>
251+
</plugin>
241252
</plugins>
242253
</pluginManagement>
243254
<plugins>
244255
<!--环境检查插件:代码编译前的环境检查 -->
245256
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-enforcer-plugin -->
257+
258+
<!-- 单元测试覆盖率插件: 强制要求 90% 覆盖率 -->
259+
<!-- https://mvnrepository.com/artifact/org.jacoco/jacoco-maven-plugin -->
260+
<plugin>
261+
<!-- 单元测试覆盖率插件: 强制要求 90% 覆盖率 -->
262+
<groupId>org.jacoco</groupId>
263+
<artifactId>jacoco-maven-plugin</artifactId>
264+
<version>${maven-jacoco-plugin.version}</version>
265+
<executions>
266+
<execution>
267+
<id>prepare-agent</id>
268+
<goals>
269+
<goal>prepare-agent</goal>
270+
</goals>
271+
</execution>
272+
<execution>
273+
<id>report</id>
274+
<phase>verify</phase>
275+
<goals>
276+
<goal>report</goal>
277+
</goals>
278+
</execution>
279+
<execution>
280+
<id>check</id>
281+
<phase>verify</phase>
282+
<goals>
283+
<goal>check</goal>
284+
</goals>
285+
<configuration>
286+
<haltOnFailure>true</haltOnFailure>
287+
<rules>
288+
<rule>
289+
<element>BUNDLE</element>
290+
<limits>
291+
<limit>
292+
<counter>LINE</counter>
293+
<value>COVEREDRATIO</value>
294+
<minimum>0.90</minimum>
295+
</limit>
296+
</limits>
297+
</rule>
298+
</rules>
299+
</configuration>
300+
</execution>
301+
</executions>
302+
</plugin>
303+
246304
<plugin>
247305
<!-- 环境检查插件:代码编译前的环境检查 -->
248306
<groupId>org.apache.maven.plugins</groupId>
@@ -397,7 +455,13 @@
397455
<!-- 将制品 staging 至 OSS Sonatype Nexus -->
398456
<groupId>org.sonatype.plugins</groupId>
399457
<artifactId>nexus-staging-maven-plugin</artifactId>
458+
</plugin> <!-- https://mvnrepository.com/artifact/org.sonatype.central/central-publishing-maven-plugin -->
459+
<plugin>
460+
<!-- 中央仓库发布插件: 将制品发布至 Maven Central -->
461+
<groupId>org.sonatype.central</groupId>
462+
<artifactId>central-publishing-maven-plugin</artifactId>
400463
</plugin>
464+
401465
</plugins>
402466
</build>
403467
</profile>
@@ -424,6 +488,8 @@
424488
<maven-help-plugin.version>3.5.0</maven-help-plugin.version>
425489
<maven-install-plugin.version>3.1.3</maven-install-plugin.version>
426490
<maven-invoker-plugin.version>3.8.0</maven-invoker-plugin.version>
491+
<maven-jacoco-plugin.version>0.8.15</maven-jacoco-plugin.version>
492+
<maven-central-publishing-plugin.version>0.11.0</maven-central-publishing-plugin.version>
427493
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
428494
<maven-javadoc-plugin.version>3.8.0</maven-javadoc-plugin.version>
429495
<maven-nexus-staging-plugin.version>1.7.0</maven-nexus-staging-plugin.version>
Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
/*
2-
* Copyright (c) 2018, hiwepy (https://github.com/hiwepy).
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5-
* use this file except in compliance with the License. You may obtain a copy of
6-
* the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13-
* License for the specific language governing permissions and limitations under
14-
* the License.
15-
*/
16-
package com.arcsoft.face.spring.boot;
17-
18-
import org.springframework.context.support.MessageSourceAccessor;
19-
import org.springframework.context.support.ResourceBundleMessageSource;
20-
21-
/**
22-
* TODO
23-
* @author : <a href="https://github.com/hiwepy">wandl</a>
24-
*/
25-
public class ArcFaceMessageSource extends ResourceBundleMessageSource {
26-
27-
// ~ Constructors
28-
// ===================================================================================================
29-
30-
public ArcFaceMessageSource() {
31-
setBasename("com.arcsoft.face.spring.boot.messages");
32-
}
33-
34-
// ~ Methods
35-
// ========================================================================================================
36-
37-
public static MessageSourceAccessor getAccessor() {
38-
return new MessageSourceAccessor(new ArcFaceMessageSource());
39-
}
40-
}
1+
/*
2+
* Copyright (c) 2018, hiwepy (https://github.com/hiwepy).
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.arcsoft.face.spring.boot;
17+
18+
import org.springframework.context.support.MessageSourceAccessor;
19+
import org.springframework.context.support.ResourceBundleMessageSource;
20+
21+
/**
22+
* TODO
23+
* @author [@Loong Wan](https://github.com/loong10k)
24+
*/
25+
public class ArcFaceMessageSource extends ResourceBundleMessageSource {
26+
27+
// ~ Constructors
28+
// ===================================================================================================
29+
30+
public ArcFaceMessageSource() {
31+
setBasename("com.arcsoft.face.spring.boot.messages");
32+
}
33+
34+
// ~ Methods
35+
// ========================================================================================================
36+
37+
public static MessageSourceAccessor getAccessor() {
38+
return new MessageSourceAccessor(new ArcFaceMessageSource());
39+
}
40+
}

0 commit comments

Comments
 (0)