Skip to content

Commit 716f177

Browse files
tilgalascopybara-github
authored andcommitted
chore: add illegal optional checkstyle check
PiperOrigin-RevId: 877955394
1 parent db0983b commit 716f177

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

pom.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<java.version>17</java.version>
4242
<maven.compiler.release>${java.version}</maven.compiler.release>
4343
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
44+
<maven.checkstyle.plugin.version>3.6.0</maven.checkstyle.plugin.version>
4445

4546
<auto-value.version>1.11.1</auto-value.version>
4647
<spring-boot.version>3.4.1</spring-boot.version>
@@ -289,6 +290,11 @@
289290
</extensions>
290291
<pluginManagement>
291292
<plugins>
293+
<plugin>
294+
<groupId>org.apache.maven.plugins</groupId>
295+
<artifactId>maven-checkstyle-plugin</artifactId>
296+
<version>${maven.checkstyle.plugin.version}</version>
297+
</plugin>
292298
<plugin>
293299
<artifactId>maven-clean-plugin</artifactId>
294300
<version>3.1.0</version>
@@ -464,6 +470,40 @@
464470
</plugins>
465471
</build>
466472
<profiles>
473+
<profile>
474+
<id>illegal-optional-check</id>
475+
<build>
476+
<plugins>
477+
<plugin>
478+
<groupId>org.apache.maven.plugins</groupId>
479+
<artifactId>maven-checkstyle-plugin</artifactId>
480+
<executions>
481+
<execution>
482+
<id>illegal-optional-check</id>
483+
<goals>
484+
<goal>check</goal>
485+
</goals>
486+
<phase>compile</phase>
487+
<configuration>
488+
<checkstyleRules>
489+
<module name="Checker">
490+
<module name="TreeWalker">
491+
<module name="SuppressWarningsHolder" />
492+
<module name="IllegalType">
493+
<property name="illegalClassNames" value="java.util.Optional" />
494+
<property name="tokens" value="PARAMETER_DEF" />
495+
</module>
496+
</module>
497+
<module name="SuppressWarningsFilter" />
498+
</module>
499+
</checkstyleRules>
500+
</configuration>
501+
</execution>
502+
</executions>
503+
</plugin>
504+
</plugins>
505+
</build>
506+
</profile>
467507
<profile>
468508
<id>release-sonatype</id>
469509
<build>

0 commit comments

Comments
 (0)