開發工具是myeclipse2013,maven3.0.5,jdk1.7,在eclipse2013中創建了一個maven web 項目,在進行maven build 的時候報錯如下:
[DEBUG] -- end configuration --
[INFO] Deploying war to http://localhost:8080/my-web-app
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.
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fmy-web-app&update=true
我的pom.mxl文件如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gyxtest.test.app</groupId>
<artifactId>my-web-app</artifactId>
<packaging>war</packaging>
<version>y</version>
<name>my-web-app Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>my-web-app</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>tomcatd</server>
<path>/my-web-app</path>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<copy todir="D:\webserver\apache-tomcat-7.0.39\webapps" file="*.*"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<!--conguration Jetty-->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
且 在 .m2/repository 中已經有了對應的slf4j-log4j12-1.7.5.jar, slf4j-api-1.7.5.jar 文件,
看http://www.slf4j.org/codes.html#StaticLoggerBinder 這個中的內容好像是 有slf4j-log4j12-1.7.5.jar 應該就可以了,而且這個jar包中已經有了org.slf4j.impl.StaticLoggerBinder 這個類了。
在網上搜了很多關於這個的資料,基本上都是把slf4j-log4j12-1.7.5.jar這個放到類路徑裏就可以了,我的maven倉庫裏也已經有了這個jar包了,怎麼還是報錯呢,請問這個slf4j-log4j12-1.7.5.jar 應該放哪裏啊?