Skip to content

Commit 35db1de

Browse files
horghclaude
andcommitted
Move checkstyle to profile activated on Java 21+
Checkstyle 13.0.0 requires Java 21+. Move the plugin into a profile that only activates on Java 21+, so `mvn test` works on Java 17 without loading incompatible classes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 92340ae commit 35db1de

File tree

1 file changed

+38
-27
lines changed

1 file changed

+38
-27
lines changed

pom.xml

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -72,33 +72,6 @@
7272
</execution>
7373
</executions>
7474
</plugin>
75-
<plugin>
76-
<groupId>org.apache.maven.plugins</groupId>
77-
<artifactId>maven-checkstyle-plugin</artifactId>
78-
<version>3.6.0</version>
79-
<configuration>
80-
<consoleOutput>true</consoleOutput>
81-
<configLocation>checkstyle.xml</configLocation>
82-
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
83-
<violationSeverity>warning</violationSeverity>
84-
</configuration>
85-
<dependencies>
86-
<dependency>
87-
<groupId>com.puppycrawl.tools</groupId>
88-
<artifactId>checkstyle</artifactId>
89-
<version>13.0.0</version>
90-
</dependency>
91-
</dependencies>
92-
<executions>
93-
<execution>
94-
<id>test</id>
95-
<phase>test</phase>
96-
<goals>
97-
<goal>check</goal>
98-
</goals>
99-
</execution>
100-
</executions>
101-
</plugin>
10275
<plugin>
10376
<groupId>org.apache.maven.plugins</groupId>
10477
<artifactId>maven-gpg-plugin</artifactId>
@@ -281,5 +254,43 @@
281254
</plugins>
282255
</build>
283256
</profile>
257+
<!-- Checkstyle 13+ requires Java 21+. -->
258+
<profile>
259+
<id>checkstyle-jdk21</id>
260+
<activation>
261+
<jdk>[21,)</jdk>
262+
</activation>
263+
<build>
264+
<plugins>
265+
<plugin>
266+
<groupId>org.apache.maven.plugins</groupId>
267+
<artifactId>maven-checkstyle-plugin</artifactId>
268+
<version>3.6.0</version>
269+
<configuration>
270+
<consoleOutput>true</consoleOutput>
271+
<configLocation>checkstyle.xml</configLocation>
272+
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
273+
<violationSeverity>warning</violationSeverity>
274+
</configuration>
275+
<dependencies>
276+
<dependency>
277+
<groupId>com.puppycrawl.tools</groupId>
278+
<artifactId>checkstyle</artifactId>
279+
<version>13.0.0</version>
280+
</dependency>
281+
</dependencies>
282+
<executions>
283+
<execution>
284+
<id>checkstyle</id>
285+
<phase>test</phase>
286+
<goals>
287+
<goal>check</goal>
288+
</goals>
289+
</execution>
290+
</executions>
291+
</plugin>
292+
</plugins>
293+
</build>
294+
</profile>
284295
</profiles>
285296
</project>

0 commit comments

Comments
 (0)