I'm trying to use elements of Google's Crawler Commons package to help with my own project in Eclipse but I'm having difficulties getting it to work due to missing dependencies. I'm new to Maven so I'm having some trouble understanding where I'm going wrong. Here are the steps I've gone through so far:
So after downloading the files here, I added the crawler-commons-0.5.jar to my Eclipse project build path. When trying to use any of the classes, such as RobotUtils for example, the following error is raised:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at crawlercommons.robots.RobotUtils.(RobotUtils.java:36) at Main.Main.main(Main.java:8) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 2 more
So I downloaded the pom.xml for this project from here and dropped it into the root folder of where the Google Crawler Commons .jar is. I use the command mvn
on it and it downloads some stuff and returns successfully. However, all it does is give me an additional folder called target with a couple of .jar files that have the correct name, but don't actually contain any of the classes I need.
So am I missing something here? How do I get mvn to grab the org.slf4j.LoggerFactory
code I need here?