Skip to content

Commit 5950134

Browse files
authored
Merge pull request #114 from Korbik/spotless_google_format
MVN: Spotless google-java-format
2 parents d92eee4 + 3f1f5e8 commit 5950134

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

Diff for: pom.xml

+43-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<nexus-staging-maven.version>1.6.7</nexus-staging-maven.version>
2424
<build-helper-maven.version>3.0.0</build-helper-maven.version>
2525
<maven-compiler-plugin.version>3.10.0</maven-compiler-plugin.version>
26+
<spotless.version>2.44.2</spotless.version>
27+
<maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
28+
<checkstyle.version>10.21.4</checkstyle.version>
2629

2730
<!-- dependencies -->
2831
<protobuf.version>3.25.5</protobuf.version>
@@ -139,6 +142,23 @@
139142
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
140143
</configuration>
141144
</plugin>
145+
<plugin>
146+
<groupId>org.apache.maven.plugins</groupId>
147+
<artifactId>maven-checkstyle-plugin</artifactId>
148+
<version>${maven-checkstyle-plugin.version}</version>
149+
<configuration>
150+
<configLocation>google_checks.xml</configLocation>
151+
<consoleOutput>true</consoleOutput>
152+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
153+
</configuration>
154+
<dependencies>
155+
<dependency>
156+
<groupId>com.puppycrawl.tools</groupId>
157+
<artifactId>checkstyle</artifactId>
158+
<version>${checkstyle.version}</version>
159+
</dependency>
160+
</dependencies>
161+
</plugin>
142162
</plugins>
143163
</pluginManagement>
144164
<plugins>
@@ -229,11 +249,32 @@
229249
</statelessTestsetInfoReporter>
230250
</configuration>
231251
</plugin>
252+
<plugin>
253+
<groupId>com.diffplug.spotless</groupId>
254+
<artifactId>spotless-maven-plugin</artifactId>
255+
<version>${spotless.version}</version>
256+
<configuration>
257+
<java>
258+
<googleJavaFormat>
259+
<reflowLongStrings>true</reflowLongStrings> <!-- optional -->
260+
<formatJavadoc>false</formatJavadoc>
261+
</googleJavaFormat>
232262

233-
263+
<removeUnusedImports>
264+
<engine>google-java-format</engine>
265+
</removeUnusedImports>
266+
</java>
267+
</configuration>
268+
<executions>
269+
<execution>
270+
<goals>
271+
<goal>check</goal>
272+
</goals>
273+
</execution>
274+
</executions>
275+
</plugin>
234276
</plugins>
235277
</build>
236-
237278
<dependencies>
238279
<dependency>
239280
<groupId>com.google.protobuf</groupId>

0 commit comments

Comments
 (0)