我的eclipse搭载的maven,所有的配置好了,参考webmagic作者写的文档开始了爬虫的编写,看了黄勇的《maven那点事》,
他让新建的一些文档也都建了,pom里的坐标也添加了,但是这里有点问题,之间的东西全都有红色波浪线,包括新添加的webmagic的坐标也是。
我直接copy的webmagic作者的代码,代码放在了src/main的目录下面,代码没显示任何错误
运行只有并没有像作者那样,控制台显示抓取的结果,而是出现了下面的情况。
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 webspider 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ webs
pider ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Users\Administrator\workspace\webspider\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ webspider ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.209s
[INFO] Finished at: Fri Jul 15 20:04:17 CST 2016
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
slf4j-api 只定义了日志接口 ,如果没有放置具体的日志实现框架,那么日志程序自然无法使用。
注意:SLF4J会自动在类路径寻找日志实现框架。