简体   繁体   中英

Using maven to download external dependencies in a netbeans web app project

I have created a Java web app project. I am loading some external library which further require some external dependecies which are not on my computer and need to be downloaded through Maven. Because of which I am getting following exception on running:-

exception : java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

I do not know how I can integrate my project (in Netbeans) with maven to download the external dependencies.
Can someone here show me the direction how to use maven in netbeans to download the dependencies from internet?

I have already installed maven 3.0.2 to my computer

Thanks

You are missing SLF4J , a standard logging framework.

You need both the SLF4J api and an implementation library, usually log4j. And the versions of the two have to fit together. Here's an example configuration (add these to your pom.xml):

<dependency>
    <!-- the API -->
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.6.1</version>
</dependency>

<dependency>
    <!-- log4j binding -->
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.6.1</version>
</dependency>

<dependency>
    <!-- redirect any commons-logging calls to slf4j -->
    <groupId>org.slf4j</groupId>
    <artifactId>jcl-over-slf4j</artifactId>
    <version>1.6.1</version>
</dependency>

Reference:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM