Spotless formatting tool fails locally but CI doesn't detect the issues. Similar to the PMD problem (#18479), there's inconsistency between local and CI environments.
After recent CI configuration changes, Spotless is not properly failing the build in CI when formatting issues are found locally. This suggests either:
Similar to the PMD issue, this suggests a configuration discrepancy. Need to ensure:
Caused by: org.apache.maven.plugin.MojoExecutionException: The following files had format violations:
target/test-classes/com/puppycrawl/tools/checkstyle/grammar/comments/InputComments1.java
@@ -1,3 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////
+//·checkstyle:·Checks·Java·source·code·and·other·text·files·for·adherence·to·a·set·of·rules.
+//·Copyright·(C)·2001-2026·the·original·author·or·authors.
+//
+//·This·library·is·free·software;·you·can·redistribute·it·and/or
+//·modify·it·under·the·terms·of·the·GNU·Lesser·General·Public
+//·License·as·published·by·the·Free·Software·Foundation;·either
+//·version·2.1·of·the·License,·or·(at·your·option)·any·later·version.
+//
+//·This·library·is·distributed·in·the·hope·that·it·will·be·useful,
+//·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
+//·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the·GNU
+//·Lesser·General·Public·License·for·more·details.
+//
+//·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public
+//·License·along·with·this·library;·if·not,·write·to·the·Free·Software
+//·Foundation,·Inc.,·59·Temple·Place,·Suite·330,·Boston,·MA··02111-1307··USA
+///////////////////////////////////////////////////////////////////////////////////////////////
+
package·com.puppycrawl.tools.checkstyle.grammar.comments;
public·class·/*
····i'mcomment567
target/test-classes/com/puppycrawl/tools/checkstyle/grammar/java16/InputPatternVariableWithModifiers.java
@@ -1,4 +1,22 @@
-//·Java17
+///////////////////////////////////////////////////////////////////////////////////////////////
+//·checkstyle:·Checks·Java·source·code·and·other·text·files·for·adherence·to·a·set·of·rules.
+//·Copyright·(C)·2001-2026·the·original·author·or·authors.
+//
+//·This·library·is·free·software;·you·can·redistribute·it·and/or
+//·modify·it·under·the·terms·of·the·GNU·Lesser·General·Public
+//·License·as·published·by·the·Free·Software·Foundation;·either
+//·version·2.1·of·the·License,·or·(at·your·option)·any·later·version.
+//
+//·This·library·is·distributed·in·the·hope·that·it·will·be·useful,
+//·but·WITHOUT·ANY·WARRANTY;·without·even·the·implied·warranty·of
+//·MERCHANTABILITY·or·FITNESS·FOR·A·PARTICULAR·PURPOSE.··See·the·GNU
+//·Lesser·General·Public·License·for·more·details.
+//
+//·You·should·have·received·a·copy·of·the·GNU·Lesser·General·Public
+//·License·along·with·this·library;·if·not,·write·to·the·Free·Software
+//·Foundation,·Inc.,·59·Temple·Place,·Suite·330,·Boston,·MA··02111-1307··USA
+///////////////////////////////////////////////////////////////////////////////////////////////
+
package·com.puppycrawl.tools.checkstyle.grammar.java16;
public·class·InputPatternVariableWithModifiers·{
target/test-classes/com/puppycrawl/tools/checkstyle/grammar/InputJava7StringSwitch.java
@@ -1,13 +1,21 @@
-/*
-com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck
... (29 more lines that didn't fit)
Violations also present in 2438 other files.
Run 'mvn spotless:apply' to fix these violations.
at com.diffplug.spotless.maven.SpotlessCheckMojo.process (SpotlessCheckMojo.java:120)
at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:275)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:565)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
➜ checkstyle git:(master) ./mvnw -e --no-transfer-progress spotless:check
Summary
Spotless formatting tool fails locally but CI doesn't detect the issues. Similar to the PMD problem (#18479), there's inconsistency between local and CI environments.
Details
After recent CI configuration changes, Spotless is not properly failing the build in CI when formatting issues are found locally. This suggests either:
Expected Behavior
Current Behavior
./mvnw spotless:check)Impact
Steps to Reproduce
./mvnw spotless:checkConfiguration Check Needed
Verify:
-DskipSpotlessor similar flags in CI configurationRelated Issues
Notes
Similar to the PMD issue, this suggests a configuration discrepancy. Need to ensure: