title: Run Maven project shows error "NoClassDefFoundError: purejavacomm/CommPortIdentifier"
body: <p>I have write a serial port code using "purejavacomm-0.0.22.jar",if running via NetBeans id 8.0.2 Build Success output came</p>
  
  <pre><code>[ttyUSB0, ttyS3, ttyS2, ttyS1, ttyS0]
  </code></pre>
  
  <p>But I have using via terminal</p>
  
  <pre><code>mvn package
  </code></pre>
  
  <p><strong>[INFO] BUILD SUCCESS</strong>
  but running the project </p>
  
  <pre><code>java -jar target/PureJavaComm-1.0-SNAPSHOT.jar 
  </code></pre>
  
  <p>I will get the error</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: purejavacomm/CommPortIdentifier
      at com.mycompany.purejavacommu.PureJavaComm.main(PureJavaComm.java:28)
  Caused by: java.lang.ClassNotFoundException: purejavacomm.CommPortIdentifier
      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)
      ... 1 more
  </code></pre>
  
  <p>My pom.xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
      &lt;artifactId&gt;PureJavaComm&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;1.7&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.7&lt;/maven.compiler.target&gt;
          &lt;mainClass&gt;com.mycompany.purejavacommu.PureJavaComm&lt;/mainClass&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;       
          &lt;dependency&gt;
              &lt;groupId&gt;com.sparetimelabs&lt;/groupId&gt;
              &lt;artifactId&gt;purejavacomm&lt;/artifactId&gt;
              &lt;version&gt;0.0.22&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                              &lt;mainClass&gt;com.mycompany.purejavacommu.PureJavaComm&lt;/mainClass&gt;                            
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;          
              &lt;/plugin&gt;
          &lt;/plugins&gt;  
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>