title: maven package executable-jar cannot run "NoClassDefFoundError"
body: <p>I compiled my project using maven <code>maven package</code> command and exported successfully created executable-jar file.</p>
  
  <p>But when I run this, just error output <code>NoclassDefFoundError</code></p>
  
  <pre><code>$ java -server -Xms512m -Xmx2048m -Dlogback.configurationFile=`pwd`/resources/logback.xml -jar stocktalk-chat-0.3.1.jar
  Error: A JNI error has occurred, please check your installation and try again
  Exception in thread "main" java.lang.NoClassDefFoundError: io/netty/channel/EventLoopGroup
          at java.lang.Class.getDeclaredMethods0(Native Method)
          at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
          at java.lang.Class.privateGetMethodRecursive(Unknown Source)
          at java.lang.Class.getMethod0(Unknown Source)
          at java.lang.Class.getMethod(Unknown Source)
          at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
          at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
  Caused by: java.lang.ClassNotFoundException: io.netty.channel.EventLoopGroup
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          ... 7 more
  </code></pre>
  
  <p>In my menifest,</p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Built-By: Administrator
  Class-Path: lib/aws-java-sdk-core-1.10.68.jar lib/commons-logging-1.1.
   3.jar lib/httpclient-4.3.6.jar lib/httpcore-4.3.3.jar lib/commons-cod
   ec-1.6.jar lib/jackson-databind-2.5.3.jar lib/jackson-annotations-2.5
   .0.jar lib/jackson-core-2.5.3.jar lib/jackson-dataformat-cbor-2.5.3.j
   ar lib/joda-time-2.8.1.jar lib/aws-java-sdk-datapipeline-1.10.68.jar 
   lib/aws-java-sdk-dynamodb-1.10.68.jar lib/aws-java-sdk-s3-1.10.68.jar
    lib/aws-java-sdk-kms-1.10.68.jar lib/gcm-server-1.0.2.jar lib/json-s
   imple-1.1.jar lib/slf4j-api-1.7.7.jar lib/logback-classic-1.1.2.jar l
   ib/logback-core-1.1.2.jar lib/jcl-over-slf4j-1.7.7.jar lib/log4j-api-
   2.5.jar lib/log4j-core-2.5.jar lib/mybatis-3.3.1.jar lib/netty-all-4.
   0.36.Final.jar lib/lombok-1.16.8.jar lib/gson-2.6.2.jar lib/jtds-1.3.
   1.jar
  Created-By: Apache Maven 3.3.9
  Build-Jdk: 1.8.0_65
  Main-Class: kr.stocktalk.chat.ChatServer
  </code></pre>
  
  <p>added all dependencies at Class-Path. </p>
  
  <p>Check my <code>pom.xml</code> please. What is the problem?</p>
  
  <pre><code>&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;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
      &lt;/properties&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;kr.stocktalk&lt;/groupId&gt;
      &lt;artifactId&gt;stocktalk-chat&lt;/artifactId&gt;
      &lt;version&gt;0.3.1&lt;/version&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.2.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;java&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;mainClass&gt;kr.stocktalk.chat.ChatServer&lt;/mainClass&gt;
                      &lt;arguments&gt;
                          &lt;argument&gt;-server&lt;/argument&gt;
                          &lt;argument&gt;-Xms512m&lt;/argument&gt;
                          &lt;argument&gt;-Xmx2048m&lt;/argument&gt;
                          &lt;argument&gt;-Dlogback.configurationFile=classpath:resources/logback.xml&lt;/argument&gt;
                      &lt;/arguments&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                      &lt;!-- &lt;compilerArgument&gt;-Xlint:all&lt;/compilerArgument&gt; --&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                      &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;!-- &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; 
                  &lt;version&gt;2.3&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;copy-dependencies&lt;/id&gt; 
                  &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;copy-dependencies&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; 
                  &lt;/executions&gt; &lt;configuration&gt; eclipse 에서는 target 밑의 lib 에 생성 됨 &lt;outputDirectory&gt;lib&lt;/outputDirectory&gt; 
                  &lt;overWriteIfNewer&gt;true&lt;/overWriteIfNewer&gt; &lt;/configuration&gt; &lt;/plugin&gt; --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;copy-dependencies&lt;/id&gt;
                          &lt;phase&gt;prepare-package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;copy-dependencies&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;outputDirectory&gt;${project.build.directory}/classes/lib&lt;/outputDirectory&gt;
                              &lt;overWriteReleases&gt;false&lt;/overWriteReleases&gt;
                              &lt;overWriteSnapshots&gt;false&lt;/overWriteSnapshots&gt;
                              &lt;overWriteIfNewer&gt;true&lt;/overWriteIfNewer&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                              &lt;mainClass&gt;kr.stocktalk.chat.ChatServer&lt;/mainClass&gt;
                              &lt;classpathPrefix&gt;lib&lt;/classpathPrefix&gt;
                          &lt;/manifest&gt;
                          &lt;!-- &lt;manifestEntries&gt;
                              &lt;Class-Path&gt;lib/&lt;/Class-Path&gt;
                          &lt;/manifestEntries&gt; --&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;src/main/resources&lt;/directory&gt;
                  &lt;targetPath&gt;resources&lt;/targetPath&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
      &lt;/build&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
              &lt;artifactId&gt;aws-java-sdk-core&lt;/artifactId&gt;
              &lt;version&gt;1.10.68&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
              &lt;artifactId&gt;aws-java-sdk-datapipeline&lt;/artifactId&gt;
              &lt;version&gt;1.10.68&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
              &lt;artifactId&gt;aws-java-sdk-dynamodb&lt;/artifactId&gt;
              &lt;version&gt;1.10.68&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.ganyo&lt;/groupId&gt;
              &lt;artifactId&gt;gcm-server&lt;/artifactId&gt;
              &lt;version&gt;1.0.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.7.7&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
              &lt;version&gt;1.1.2&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;1.7.7&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mybatis&lt;/groupId&gt;
              &lt;artifactId&gt;mybatis&lt;/artifactId&gt;
              &lt;version&gt;3.3.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.netty&lt;/groupId&gt;
              &lt;artifactId&gt;netty-all&lt;/artifactId&gt;
              &lt;version&gt;4.0.36.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
              &lt;version&gt;1.16.8&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;version&gt;2.6.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sourceforge.jtds&lt;/groupId&gt;
              &lt;artifactId&gt;jtds&lt;/artifactId&gt;
              &lt;version&gt;1.3.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>