Skip to content

Commit 4b281f7

Browse files
committed
feature: 不直接继承 myoss-spring-boot-parent。去掉 spring-javaformat-checkstyle(这个三元表达式格式校验太烦了),解决 checkstyle 插件运行找不到 class 的问题
Caused by: java.lang.ClassNotFoundException: com.puppycrawl.tools.checkstyle.utils.CommonUtils
1 parent 233b008 commit 4b281f7

File tree

4 files changed

+189
-15
lines changed

4 files changed

+189
-15
lines changed

code-format-checkstyle/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@
5858
<artifactId>checkstyle</artifactId>
5959
<version>${puppycrawl-tools-checkstyle.version}</version>
6060
</dependency>
61-
<dependency>
62-
<groupId>io.spring.javaformat</groupId>
63-
<artifactId>spring-javaformat-checkstyle</artifactId>
64-
<version>${spring-javaformat-checkstyle.version}</version>
65-
</dependency>
6661
</dependencies>
6762
<executions>
6863
<execution>

code-format-checkstyle/src/main/resources/checkstyle/checkstyle.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,5 @@
259259
<property name="lineWrappingIndentation" value="8"/>
260260
</module>
261261
<module name="TrailingComment"/>
262-
263-
<!-- Spring Conventions -->
264-
<module name="io.spring.javaformat.checkstyle.check.SpringTernaryCheck"/>
265262
</module>
266263
</module>

code-format-eclipse/pom.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,46 @@
4949
<version>18.0.132.637.0-Eclipse_4.7.3a</version>
5050
</dependency>
5151
</dependencies>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<!-- 检查代码格式 -->
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-checkstyle-plugin</artifactId>
59+
<version>3.0.0</version>
60+
<dependencies>
61+
<dependency>
62+
<groupId>com.puppycrawl.tools</groupId>
63+
<artifactId>checkstyle</artifactId>
64+
<version>${puppycrawl-tools-checkstyle.version}</version>
65+
</dependency>
66+
<dependency>
67+
<groupId>app.myoss.cloud.codestyle</groupId>
68+
<artifactId>code-format-checkstyle</artifactId>
69+
<version>${project.version}</version>
70+
</dependency>
71+
</dependencies>
72+
<executions>
73+
<execution>
74+
<id>checkstyle-validation</id>
75+
<phase>validate</phase>
76+
<configuration>
77+
<skip>${disable.checks}</skip>
78+
<configLocation>checkstyle/checkstyle.xml</configLocation>
79+
<suppressionsLocation>checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
80+
<headerLocation>checkstyle/checkstyle-header.txt</headerLocation>
81+
<encoding>UTF-8</encoding>
82+
<consoleOutput>true</consoleOutput>
83+
<failsOnError>true</failsOnError>
84+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
85+
</configuration>
86+
<goals>
87+
<goal>check</goal>
88+
</goals>
89+
</execution>
90+
</executions>
91+
</plugin>
92+
</plugins>
93+
</build>
5294
</project>

pom.xml

Lines changed: 147 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6-
<parent>
7-
<groupId>app.myoss.cloud</groupId>
8-
<artifactId>myoss-spring-boot-parent</artifactId>
9-
<version>2.1.0.RELEASE</version>
10-
</parent>
116

127
<groupId>app.myoss.cloud.codestyle</groupId>
138
<artifactId>java-code-style</artifactId>
@@ -43,9 +38,16 @@
4338
</developers>
4439

4540
<properties>
41+
<java.version>1.8</java.version>
42+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
43+
<maven.compiler.source>${java.version}</maven.compiler.source>
44+
<maven.compiler.target>${java.version}</maven.compiler.target>
45+
4646
<!-- third party -->
47-
<puppycrawl-tools-checkstyle.version>8.18</puppycrawl-tools-checkstyle.version>
48-
<spring-javaformat-checkstyle.version>0.0.5</spring-javaformat-checkstyle.version>
47+
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
48+
<maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
49+
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
50+
<puppycrawl-tools-checkstyle.version>8.19</puppycrawl-tools-checkstyle.version>
4951
<!-- third party -->
5052
</properties>
5153

@@ -61,5 +63,143 @@
6163
<artifactId>myoss-starter-core</artifactId>
6264
</dependency>
6365
<!-- myoss cloud dependencies end -->
66+
67+
<dependency>
68+
<groupId>junit</groupId>
69+
<artifactId>junit</artifactId>
70+
<version>4.12</version>
71+
<scope>test</scope>
72+
</dependency>
73+
<dependency>
74+
<groupId>org.assertj</groupId>
75+
<artifactId>assertj-core</artifactId>
76+
<version>3.11.1</version>
77+
<scope>test</scope>
78+
</dependency>
6479
</dependencies>
80+
81+
<dependencyManagement>
82+
<dependencies>
83+
<dependency>
84+
<groupId>app.myoss.cloud</groupId>
85+
<artifactId>myoss-cloud-dependencies</artifactId>
86+
<version>2.1.4.RELEASE</version>
87+
<type>pom</type>
88+
<scope>import</scope>
89+
</dependency>
90+
</dependencies>
91+
</dependencyManagement>
92+
93+
<build>
94+
<plugins>
95+
<plugin>
96+
<artifactId>maven-resources-plugin</artifactId>
97+
<version>${maven-resources-plugin.version}</version>
98+
<executions>
99+
<execution>
100+
<id>copy-other-resources</id>
101+
<phase>process-sources</phase>
102+
<goals>
103+
<goal>copy-resources</goal>
104+
</goals>
105+
<configuration>
106+
<outputDirectory>${basedir}/target/classes</outputDirectory>
107+
<resources>
108+
<resource>
109+
<!-- 先复制父项目中的 README/LICENSE 文件,再用自己项目中的 README/LICENSE 文件覆盖(如果有的话) -->
110+
<directory>../</directory>
111+
<includes>
112+
<include>README.md</include>
113+
<include>readme.md</include>
114+
<include>LICENSE</include>
115+
</includes>
116+
</resource>
117+
<resource>
118+
<directory>${basedir}</directory>
119+
<includes>
120+
<include>README.md</include>
121+
<include>readme.md</include>
122+
<include>LICENSE</include>
123+
</includes>
124+
</resource>
125+
</resources>
126+
<overwrite>true</overwrite>
127+
</configuration>
128+
</execution>
129+
</executions>
130+
</plugin>
131+
<plugin>
132+
<!-- generate sources code attachments -->
133+
<groupId>org.apache.maven.plugins</groupId>
134+
<artifactId>maven-source-plugin</artifactId>
135+
<version>${maven-source-plugin.version}</version>
136+
<executions>
137+
<execution>
138+
<id>attach-sources</id>
139+
<goals>
140+
<goal>jar-no-fork</goal>
141+
</goals>
142+
</execution>
143+
</executions>
144+
</plugin>
145+
<plugin>
146+
<!-- generate javadoc attachments -->
147+
<groupId>org.apache.maven.plugins</groupId>
148+
<artifactId>maven-javadoc-plugin</artifactId>
149+
<version>${maven-javadoc-plugin.version}</version>
150+
<executions>
151+
<execution>
152+
<id>attach-javadoc</id>
153+
<goals>
154+
<goal>jar</goal>
155+
</goals>
156+
</execution>
157+
</executions>
158+
<configuration>
159+
<charset>UTF-8</charset>
160+
<encoding>UTF-8</encoding>
161+
<docencoding>UTF-8</docencoding>
162+
<failOnError>true</failOnError>
163+
</configuration>
164+
</plugin>
165+
<plugin>
166+
<!-- GPG Signed Components -->
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-gpg-plugin</artifactId>
169+
<version>1.6</version>
170+
<executions>
171+
<execution>
172+
<id>sign-artifacts</id>
173+
<phase>verify</phase>
174+
<goals>
175+
<goal>sign</goal>
176+
</goals>
177+
</execution>
178+
</executions>
179+
</plugin>
180+
</plugins>
181+
</build>
182+
183+
<profiles>
184+
<profile>
185+
<id>oss-nexus-auto-releases</id>
186+
<build>
187+
<plugins>
188+
<plugin>
189+
<!-- Nexus Staging Plugin, auto deploy close and release -->
190+
<!-- 该插件允许你方便的将组件发布到Maven中央仓库, 而不需要登录OSSRH网站自己去Close然后又Release -->
191+
<groupId>org.sonatype.plugins</groupId>
192+
<artifactId>nexus-staging-maven-plugin</artifactId>
193+
<version>1.6.8</version>
194+
<extensions>true</extensions>
195+
<configuration>
196+
<serverId>nexus-releases</serverId>
197+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
198+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
199+
</configuration>
200+
</plugin>
201+
</plugins>
202+
</build>
203+
</profile>
204+
</profiles>
65205
</project>

0 commit comments

Comments
 (0)