How to resolve the SLF4J failure in Maven?

Asked

Viewed 6,578 times

6

Problem with Maven install:


When I spin in the eclipse Run As > Maven install I always get that message:


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ProjetoTeste 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 

Why does it happen SLF4J: Failed and how to resolve?


Observing: I use Maven for Eclipse and with Java.

  • In the archive pom.xml I have not added these libraries, the entire build path configuration I am performing through it. Am I correct in saying that it would be the build path of mavem? I ask this why on eclipse has a place called build path (where I set up jars in an eclipse project).

  • For those who are still having the problem. Delete the folder where Maven saves dependencies and download again.

3 answers

6


When you talked about Eclipse, I soon thought it was a bug of the plugin m2e (Maven to Eclipse), which is the Eclipse plugin for integration with Maven without command line. Said and done!

This is not a problem with your project!

I did a test with my Eclipse and initially could not reproduce the problem. So I found this topic on SOEN and the question seems to be with the built-in Maven installation that already comes with the plugin. When switching to an external installation the problem disappears.

I removed my external installation of Maven to play the messages. In the image below, captured a few moments ago, I show the error below and the configuration to add an external installation above:

Adicionando uma nova instalação

After adding to another installation, the problem no longer occurs.

maven externo

Upshot:

Resultado após maven externo

  • Thank you very much solved problem, helped a lot and if I understand well the eclipse comes with a default setup of the maven! Only need to inform where the folder of maven. @utluiz I have a question about the setting.xml should create another topic or ask right here?

  • @Eduardobentorochajunior I think it would be better to create another.

1

Another quick (and dirty) solution to the "SLF4J" bug (if you want to keep the built-in Maven version):

Copy files: "slf4j-api-[any-version].jar" and "slf4j-simple-[any-version].jar", into the tablet $JAVA_HOME/jre/lib/ext

Where: $JAVA_HOME is the path where you installed your Java.

Obs.: Both ". jar" can be found within the downloadable package available at: https://www.slf4j.org/download.html

This was the solution I adopted.

0

I had trouble with examples. Tomcat did not work in version 1.5.9.RELEASE:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.9.RELEASE</version>
    <relativePath/> 
</parent>

Error
SLF4J: Failed to load class "org.slf4j.impl.Staticloggerbinder".
SLF4J: Defaulting to no-Operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further Details.

Solution was to change the version to 1.5.0.RELEASE and it worked perfect.

Tomcat Started on port(s): 8080 (http)
Started Demo01application in 4.829 Seconds (JVM running for 5.402)
Initializing Spring Frameworkservlet 'dispatcherServlet'
Frameworkservlet 'dispatcherServlet': initialization Started
Frameworkservlet 'dispatcherServlet': initialization completed in 28 ms

Browser other questions tagged

You are not signed in. Login or sign up in order to post.