title: Integrating slf4j with maven
body: <p>Hello guys I am new to Maven and I am trying to integrate slf4j in a maven project
  Here is my pom.xml file</p>
  
  <pre><code>&lt;dependency&gt;
   &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
   &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
   &lt;version&gt;1.7.9&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>And  I have these two lines in my main function</p>
  
  <pre><code>Logger logger = LoggerFactory.getLogger(App.class);
  logger.info("Hello World");
  </code></pre>
  
  <p>Project is compiled and packaged successfully but when I try to run it
  through<br/>
  java -cp target/maven-1.0-SNAPSHOT.jar com.goutam.maven.App
  The following Exception is thrown</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
      at com.goutam.maven.App.main(App.java:11)
  Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  </code></pre>