2021年4月3日星期六

Slf4j and Logback error: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

I'm working on a simple Java application where I'm not using any mayor framework, just maven for building and dependency management, Lombok to avoid boilerplate and sfl4j and Logback for logging duties. When I run the application directly trough IntelliJ IDE, it works perfect, but when I try to run the maven generated jar file from the command line, I'm getting the error java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory.

My maven pom looks as follows:

<dependencies>      <dependency>        <groupId>ch.qos.logback</groupId>        <artifactId>logback-core</artifactId>        <version>1.2.3</version>      </dependency>      <dependency>        <groupId>org.slf4j</groupId>        <artifactId>slf4j-api</artifactId>        <version>1.7.30</version>      </dependency>      <dependency>        <groupId>ch.qos.logback</groupId>        <artifactId>logback-classic</artifactId>        <version>1.2.3</version>      </dependency>      ...  

Any idea?

https://stackoverflow.com/questions/66937027/slf4j-and-logback-error-java-lang-noclassdeffounderror-org-slf4j-loggerfactory April 04, 2021 at 08:29AM

没有评论:

发表评论