question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maven plugin incompatible with 3.3.9

See original GitHub issue

Summary of problem

Using the Spotless plugin in a Maven project and applying with Maven 3.3.9 throws an exception when I mvn spotless:check.

It looks like this is only in 1.21.1, this was fine in 1.20.0.

  • Gradle or maven version - Maven 3.3.9
  • spotless version - 1.21.1
  • operating system and version - Macos 10.14.3
  • copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
<plugin>
    <groupId>com.diffplug.spotless</groupId>
    <artifactId>spotless-maven-plugin</artifactId>
    <version>1.21.1</version>
    <executions>
        <execution>
            <id>check</id>
            <goals>
                <goal>check</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <java>
            <eclipse>
                <version>4.10.0</version>
                <file>path/to/eclipse-formatter.xml</file>
            </eclipse>
            <importOrder>
                <file>path/to/java.importorder</file>
            </importOrder>
            <removeUnusedImports />
        </java>
        <formats>
            <format>
                <!-- XML files -->
                <includes>
                    <include>src/main/**/*.xml</include>
                    <include>**/pom.xml</include>
                </includes>
                <excludes>
                    <exclude>src/main/resources/rebel-remote.xml</exclude>
                    <exclude>src/main/resources/rebel.xml</exclude>
                    <exclude>**/target/**/pom.xml</exclude>
                </excludes>
                <indent>
                    <spaces>true</spaces>
                    <spacesPerTab>4</spacesPerTab>
                </indent>
                <trimTrailingWhitespace />
            </format>
            <format>
                <includes>
                    <!-- YAML -->
                    <include>src/main/**/*.yml</include>
                    <include>src/main/**/*.yaml</include>
                    <!-- JS within Java projects -->
                    <include>src/main/**/*.js</include>
                    <!-- SQL imports -->
                    <include>src/main/**/*.sql</include>
                </includes>
                <indent>
                    <spaces>true</spaces>
                    <spacesPerTab>2</spacesPerTab>
                </indent>
                <trimTrailingWhitespace />
            </format>
        </formats>
    </configuration>
</plugin>
  • copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace

https://gist.github.com/phillipuniverse/db14a796ffb4e8392da89c790537fd02

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
nedtwiggcommented, Apr 9, 2019

@lutovich might be able to correct me, but it might be as simple as 3.5.2 was the version that he or I were using when we set up mvnw. But it should be 3.1.0 since we claim to support it.

0reactions
fvghcommented, Dec 26, 2021

Exclusion of classworlds:classworlds did not fix the problem. Using the latest org.codehaus.plexus:plexus-resources version 1.2.0 (which does not depend on classworlds), did not fix the problem.

The problem is not deterministic. But it has been found with the latest version, that it only occurred with the install goal, but not when calling the spotless plugin goals directly. Hence it seems unlikely that the problem is caused by spotless. It is assumed that Maven 3.1.0 has a bug.

Original problem with Maven 3.3.9 was not reproducible with reasonable effort.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PluginIncompatibleException (Apache Maven 3.3.9 API)
public class PluginIncompatibleException extends PluginManagerException. Signals a plugin which is not compatible with the current Maven runtime.
Read more >
Problem with Maven war plugin 3.0.0 due to an API ...
The versions of Maven and Java are very current, but the war plugin version is not. Try using the most current version, which...
Read more >
[NMAP-9] Incompatible with Maven 3.1.0 - JFrog JIRA
The plugin is incompatible with Maven 3.1.0. Attempting to use it will cause a NoClassDefFoundError. ... This appears to be due to Aether...
Read more >
All Maven projects start with failure - cannot open zip file
[ERROR] Failed to parse plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1 ...
Read more >
While trying to deploy through maven build, getting error ...
Execution deploy of goal org.mule.tools.maven:mule-maven-plugin:3.3.5:deploy failed: 409 Conflict: {"message":"Application is already being ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found