Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spotless-maven-plugin version 2.38.0 failing on JDK 21 RC1 (EA-35) #1791

Closed
khmarbaise opened this issue Aug 27, 2023 · 2 comments
Closed

spotless-maven-plugin version 2.38.0 failing on JDK 21 RC1 (EA-35) #1791

khmarbaise opened this issue Aug 27, 2023 · 2 comments

Comments

@khmarbaise
Copy link

Environment:

$> mvn --version
Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)
Maven home: /Users/khm/tools/maven
Java version: 21, vendor: Oracle Corporation, runtime: /Users/khm/.sdkman/candidates/java/21.ea.35-open
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "13.4.1", arch: "aarch64", family: "mac"

Spotless Maven Plugin Version 2.38.0 (instead of 2.37.0 overwritten via manual change in the pom.xml file):
Summary:
Building the Maven source code itself (apache/maven@7d66d19) will result in the following:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.38.0:check (default) on project maven-api-meta: Execution default of goal com.diffplug.spotless:spotless-maven-plugin:2.38.0:check failed: An API incompatibility was encountered while executing com.diffplug.spotless:spotless-maven-plugin:2.38.0:check: java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree com.sun.tools.javac.tree.JCTree$JCImport.getQualifiedIdentifier()'
[ERROR] -----------------------------------------------------

MacOS/Linux

The configuration block(inherited from our parent (maven-parent version 40):

        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>2.37.0</version>
          <configuration>
            <java>
              <!-- orders of used formatters are important MPOM-376 -->
              <!-- eg. palantir override importOrder, so should be first -->
              <palantirJavaFormat />
              <removeUnusedImports />
              <importOrder>
                <file>config/maven-eclipse-importorder.txt</file>
              </importOrder>
              <licenseHeader>
                <file>config/maven-header-plain.txt</file>
              </licenseHeader>
            </java>
            <pom>
              <sortPom>
                <expandEmptyElements>false</expandEmptyElements>
                <!-- https://issues.apache.org/jira/browse/MRELEASE-1111 -->
                <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
              </sortPom>
            </pom>
            <upToDateChecking>
              <enabled>true</enabled>
            </upToDateChecking>
          </configuration>

The full stack trace:

[INFO] Index file does not exist. Fallback to an empty index
[DEBUG] Allocating an additional FeatureClassLoader for key=com.diffplug.spotless.JarState@64dcfd09 Cache.size was 1
[ERROR] Step 'palantir-java-format' found problem in 'src/main/java/org/apache/maven/api/annotations/Nonnull.java':
'com.sun.tools.javac.tree.JCTree com.sun.tools.javac.tree.JCTree$JCImport.getQualifiedIdentifier()'
java.lang.NoSuchMethodError: 'com.sun.tools.javac.tree.JCTree com.sun.tools.javac.tree.JCTree$JCImport.getQualifiedIdentifier()'
    at com.palantir.javaformat.java.RemoveUnusedImports.getSimpleName (RemoveUnusedImports.java:245)
    at com.palantir.javaformat.java.RemoveUnusedImports.buildReplacements (RemoveUnusedImports.java:225)
    at com.palantir.javaformat.java.RemoveUnusedImports.removeUnusedImports (RemoveUnusedImports.java:209)
    at com.diffplug.spotless.glue.pjf.PalantirJavaFormatFormatterFunc.apply (PalantirJavaFormatFormatterFunc.java:42)
    at com.diffplug.spotless.FormatterFunc.apply (FormatterFunc.java:32)
    at com.diffplug.spotless.FormatterStepImpl$Standard.format (FormatterStepImpl.java:82)
    at com.diffplug.spotless.FormatterStep$Strict.format (FormatterStep.java:103)
    at com.diffplug.spotless.Formatter.compute (Formatter.java:246)
    at com.diffplug.spotless.PaddedCell.calculateDirtyState (PaddedCell.java:203)
    at com.diffplug.spotless.PaddedCell.calculateDirtyState (PaddedCell.java:190)
    at com.diffplug.spotless.maven.SpotlessCheckMojo.process (SpotlessCheckMojo.java:54)
    at com.diffplug.spotless.maven.AbstractSpotlessMojo.execute (AbstractSpotlessMojo.java:229)
    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:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    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)
[INFO] ------------------------------------------------------------------------

If you need more information please state so I can help.

@jvissers
Copy link

Check: #1774

@nedtwigg
Copy link
Member

nedtwigg commented Dec 4, 2023

@nedtwigg nedtwigg closed this as completed Dec 4, 2023
fourls added a commit to integrated-application-development/delphilint that referenced this issue Jul 1, 2024
The previous spotless version has Java 21 compatibility issues,
see diffplug/spotless#1791 for more.
fourls added a commit to integrated-application-development/delphilint that referenced this issue Jul 1, 2024
The previous spotless version has Java 21 compatibility issues,
see diffplug/spotless#1791 for more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants