Skip to content

Commit 1b63f1e

Browse files
committed
Do not run checkstyle on unsupported JDK versions
1 parent 5b23dad commit 1b63f1e

1 file changed

Lines changed: 48 additions & 38 deletions

File tree

‎pom.xml‎

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -657,44 +657,6 @@
657657
<inherited>false</inherited>
658658
</plugin>
659659

660-
<plugin>
661-
<!-- Checking style of code matches the Google code style -->
662-
<groupId>org.apache.maven.plugins</groupId>
663-
<artifactId>maven-checkstyle-plugin</artifactId>
664-
<version>${maven-checkstyle-plugin.version}</version>
665-
666-
<configuration>
667-
<configLocation>.mvn/checkstyle/checkstyle.xml</configLocation>
668-
<consoleOutput>true</consoleOutput>
669-
<failsOnError>true</failsOnError>
670-
<includeResources>true</includeResources>
671-
<sourceDirectories>${project.basedir}/src</sourceDirectories>
672-
<suppressionsLocation>.mvn/checkstyle/suppressions.xml</suppressionsLocation>
673-
<violationSeverity>info</violationSeverity>
674-
</configuration>
675-
676-
<!-- This is inherited to recurse, but each project must set
677-
the <relativePath/> attribute correctly. -->
678-
679-
<executions>
680-
<execution>
681-
<phase>validate</phase>
682-
<goals>
683-
<goal>check</goal>
684-
</goals>
685-
</execution>
686-
</executions>
687-
688-
<dependencies>
689-
<dependency>
690-
<!-- Force the usage of checkstyle v10 rather than v8.28 -->
691-
<groupId>com.puppycrawl.tools</groupId>
692-
<artifactId>checkstyle</artifactId>
693-
<version>${checkstyle.version}</version>
694-
</dependency>
695-
</dependencies>
696-
</plugin>
697-
698660
<plugin>
699661
<!--
700662
Intercepts the default deploy phase and replaces it with goals that
@@ -723,6 +685,54 @@
723685
</build>
724686

725687
<profiles>
688+
<profile>
689+
<id>checkstyle</id>
690+
<activation>
691+
<jdk>[21,)</jdk>
692+
</activation>
693+
<build>
694+
<plugins>
695+
<plugin>
696+
<!-- Checking style of code matches the Google code style -->
697+
<groupId>org.apache.maven.plugins</groupId>
698+
<artifactId>maven-checkstyle-plugin</artifactId>
699+
<version>${maven-checkstyle-plugin.version}</version>
700+
701+
<configuration>
702+
<configLocation>.mvn/checkstyle/checkstyle.xml</configLocation>
703+
<consoleOutput>true</consoleOutput>
704+
<failsOnError>true</failsOnError>
705+
<includeResources>true</includeResources>
706+
<sourceDirectories>${project.basedir}/src</sourceDirectories>
707+
<suppressionsLocation>.mvn/checkstyle/suppressions.xml</suppressionsLocation>
708+
<violationSeverity>info</violationSeverity>
709+
</configuration>
710+
711+
<!-- This is inherited to recurse, but each project must set
712+
the <relativePath/> attribute correctly. -->
713+
714+
<executions>
715+
<execution>
716+
<phase>validate</phase>
717+
<goals>
718+
<goal>check</goal>
719+
</goals>
720+
</execution>
721+
</executions>
722+
723+
<dependencies>
724+
<dependency>
725+
<!-- Force the usage of checkstyle v10 rather than v8.28 -->
726+
<groupId>com.puppycrawl.tools</groupId>
727+
<artifactId>checkstyle</artifactId>
728+
<version>${checkstyle.version}</version>
729+
</dependency>
730+
</dependencies>
731+
</plugin>
732+
</plugins>
733+
</build>
734+
</profile>
735+
726736
<profile>
727737
<id>releases</id>
728738

0 commit comments

Comments
 (0)