Skip to content

Commit 7a8bcc3

Browse files
committed
Move Checkstyle to the root pom.xml
1 parent 8dbce72 commit 7a8bcc3

File tree

2 files changed

+48
-52
lines changed

2 files changed

+48
-52
lines changed

extra/pom.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>
3030
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
3131
<docker-maven-plugin.version>0.44.0</docker-maven-plugin.version>
32+
<checkstyle-plugin.version>3.6.0</checkstyle-plugin.version>
33+
<checkstyle.version>10.17.0</checkstyle.version>
3234

3335
<!-- Project production dependency versions -->
3436
<spring.boot.version>3.2.3</spring.boot.version>
@@ -263,6 +265,35 @@
263265

264266
<build>
265267
<plugins>
268+
<plugin>
269+
<groupId>org.apache.maven.plugins</groupId>
270+
<artifactId>maven-checkstyle-plugin</artifactId>
271+
<version>${checkstyle-plugin.version}</version>
272+
<configuration>
273+
<!-- Project rooted path to CheckStyle configuration file. -->
274+
<configLocation>${maven.multiModuleProjectDirectory}/checkstyle.xml</configLocation>
275+
<consoleOutput>true</consoleOutput>
276+
<!-- true if project build should fails on any style violation. -->
277+
<failsOnError>true</failsOnError>
278+
<linkXRef>false</linkXRef>
279+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
280+
</configuration>
281+
<executions>
282+
<execution>
283+
<phase>validate</phase>
284+
<goals>
285+
<goal>checkstyle-aggregate</goal>
286+
</goals>
287+
</execution>
288+
</executions>
289+
<dependencies>
290+
<dependency>
291+
<groupId>com.puppycrawl.tools</groupId>
292+
<artifactId>checkstyle</artifactId>
293+
<version>${checkstyle.version}</version>
294+
</dependency>
295+
</dependencies>
296+
</plugin>
266297
<plugin>
267298
<groupId>org.apache.maven.plugins</groupId>
268299
<artifactId>maven-release-plugin</artifactId>
@@ -296,4 +327,21 @@
296327
</plugin>
297328
</plugins>
298329
</build>
330+
331+
<reporting>
332+
<plugins>
333+
<plugin>
334+
<groupId>org.apache.maven.plugins</groupId>
335+
<artifactId>maven-checkstyle-plugin</artifactId>
336+
<version>${checkstyle-plugin.version}</version>
337+
<reportSets>
338+
<reportSet>
339+
<reports>
340+
<report>checkstyle</report>
341+
</reports>
342+
</reportSet>
343+
</reportSets>
344+
</plugin>
345+
</plugins>
346+
</reporting>
299347
</project>

pom.xml

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
<dockerfileName>Dockerfile</dockerfileName>
2323

2424
<!-- plugin versions -->
25-
<checkstyle-plugin.version>3.4.0</checkstyle-plugin.version>
26-
<checkstyle.version>10.17.0</checkstyle.version>
2725
<download-plugin.version>1.9.0</download-plugin.version>
2826
<git-commmit-plugin.version>4.9.10</git-commmit-plugin.version>
2927

@@ -398,28 +396,6 @@
398396
</execution>
399397
</executions>
400398
</plugin>
401-
<plugin>
402-
<groupId>org.apache.maven.plugins</groupId>
403-
<artifactId>maven-checkstyle-plugin</artifactId>
404-
<version>${checkstyle-plugin.version}</version>
405-
<configuration>
406-
<!-- Project rooted path to CheckStyle configuration file. -->
407-
<configLocation>checkstyle.xml</configLocation>
408-
<encoding>UTF-8</encoding>
409-
<consoleOutput>true</consoleOutput>
410-
<!-- true if project build should fails on any style violation. -->
411-
<failsOnError>true</failsOnError>
412-
<linkXRef>false</linkXRef>
413-
<includeTestSourceDirectory>true</includeTestSourceDirectory>
414-
</configuration>
415-
<dependencies>
416-
<dependency>
417-
<groupId>com.puppycrawl.tools</groupId>
418-
<artifactId>checkstyle</artifactId>
419-
<version>${checkstyle.version}</version>
420-
</dependency>
421-
</dependencies>
422-
</plugin>
423399
<plugin>
424400
<groupId>org.codehaus.gmavenplus</groupId>
425401
<artifactId>gmavenplus-plugin</artifactId>
@@ -455,18 +431,6 @@
455431
</execution>
456432
</executions>
457433
</plugin>
458-
<plugin>
459-
<groupId>org.apache.maven.plugins</groupId>
460-
<artifactId>maven-checkstyle-plugin</artifactId>
461-
<executions>
462-
<execution>
463-
<phase>validate</phase>
464-
<goals>
465-
<goal>checkstyle</goal>
466-
</goals>
467-
</execution>
468-
</executions>
469-
</plugin>
470434
<plugin>
471435
<groupId>org.xolstice.maven.plugins</groupId>
472436
<artifactId>protobuf-maven-plugin</artifactId>
@@ -690,22 +654,6 @@
690654
</plugins>
691655
</build>
692656

693-
<reporting>
694-
<plugins>
695-
<plugin>
696-
<groupId>org.apache.maven.plugins</groupId>
697-
<artifactId>maven-checkstyle-plugin</artifactId>
698-
<reportSets>
699-
<reportSet>
700-
<reports>
701-
<report>checkstyle</report>
702-
</reports>
703-
</reportSet>
704-
</reportSets>
705-
</plugin>
706-
</plugins>
707-
</reporting>
708-
709657
<profiles>
710658
<profile>
711659
<!-- Run only one application container instance on fixed ports for debugging purposes -->

0 commit comments

Comments
 (0)