SonarQube Scanner Fails with NoSuchMethodError on Logger.atInfo() Despite Using SLF4J 2.0.7

We recently upgraded to SonarQube Enterprise Edition 2025.1.1 (build 104738) and are using the Maven Sonar Scanner plugin version 3.9.1.2184.

Our project builds using Java 8 and is currently using SLF4J 2.0.7 in both dependencyManagement and dependencies. However, every attempt to run sonar:sonar results in the following error:

java.lang.NoSuchMethodError: ‘org.slf4j.spi.LoggingEventBuilder org.slf4j.Logger.atInfo()’
at org.sonarsource.scanner.api.internal.SLF4JLogger.info(SLF4JLogger.java:43)

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar

e’ve already tried:

  • Upgrading SLF4J to 2.0.7 across the project
  • Removing all transitive SLF4J 1.7.x dependencies
  • Running the scan with Java 17
  • Running sonar:sonar from a separate minimal POM to isolate scanner classpath
  • Verified that no SLF4J 1.7 JARs are present using mvn dependency:tree -Dincludes=org.slf4j

Despite all this, the error persists.

Hi,

Welcome to the community!

That’s a really old version of SonarScanner for Maven. The current version is 5.1. You should upgrade, and then add sonar.java.jdkHome to your analysis parameters.

If that doesn’t work, can you provide the full analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Thx,
Ann