maven-checkstyle-plugin: NoSuchMethodError: 'void org.slf4j.spi.LocationAwareLogger.log(org.slf4j.Marker, java.lang.String, int, java.lang.String, java.lang.Throwable)'
See original GitHub issuein pom.xml:
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>com.spotify.checkstyle</groupId>
<artifactId>spotify-checkstyle-config</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.4</version>
</dependency>
</dependencies>
<configuration>
<configLocation>spotify_checks.xml</configLocation>
<consoleOutput>true</consoleOutput>
<!-- Remove or switch to false to keep building even with checkstyle errors -->
<failOnViolation>true</failOnViolation>
<logViolationsToConsole>true</logViolationsToConsole>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
</sourceDirectories>
</configuration>
<executions>
<execution>
<id>default</id>
<phase>process-test-classes</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
Regular Maven build works fine, but with mvnd I get this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (default) on project contentdeploy-master-2: Execution default of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check: java.lang.NoSuchMethodError: 'void org.slf4j.spi.LocationAwareLogger.log(org.slf4j.Marker, java.lang.String, int, java.lang.String, java.lang.Throwable)'
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-checkstyle-plugin:2.17
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
Environment:
$ mvnd --version
Maven Daemon 0.0.11-linux-amd64 (native)
Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.linux.LinuxNativePty
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/mikaelstaldal/bin/mvnd-0.0.11-linux-amd64/mvn
Java version: 11.0.9, vendor: Amazon.com Inc., runtime: /usr/lib/jvm/java-11-amazon-corretto
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-52-generic", arch: "amd64", family: "unix"
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
maven-checkstyle-plugin: NoSuchMethodError: 'void org.slf4j ...
maven-checkstyle-plugin : NoSuchMethodError: 'void org.slf4j.spi.LocationAwareLogger.log(org.slf4j.Marker, java.lang.String, int, java.lang.String, java.lang ...
Read more >14 - Stack Overflow
Try to downgrade SLF4J version. This error usually pops up when some library requires older / newer version of SLF4J.
Read more >Changes - Oracle Support
Oracle WebLogic Server - Version 12.1.1.0 and later: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker ...
Read more >JIRA Startup fails with java.lang.NoSuchMethodError: org.slf4j ...
An Error occurred during ComponentContainerLauncher servlet context initialisation - org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The problem comes from the way
mvnd
is launched. The jars that consist the main mvnd class path are leaking to plugins because the setup is slightly different. I’ll try to fix it so that we can have a classloader setup similar to the maven one.Your workaround works for me.