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-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 issue

in 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:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
gnodetcommented, Feb 9, 2021

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.

1reaction
mikaelstaldalcommented, Nov 13, 2020

Your workaround works for me.

Read more comments on GitHub >

github_iconTop 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 >
java.lang.NoSuchMethodError: org.slf4j.spi.Loca... - JBoss.org
If I try to use Weld.
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 >

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