Run executable jar from command line fails due to missing library
<p>I created an executable jar from maven with the following build config:</p>

<pre><code>&lt;plugins&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;3.2&lt;/version&gt;
    &lt;configuration&gt;
      &lt;source&gt;1.8&lt;/source&gt;
      &lt;target&gt;1.8&lt;/target&gt;
    &lt;/configuration&gt;
  &lt;/plugin&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}/${project.build.targetName}/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;excludeScope&gt;test&lt;/excludeScope&gt;
                &lt;includeScope&gt;compile&lt;/includeScope&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;classpathPrefix&gt;lib/&lt;/classpathPrefix&gt;
                &lt;packageName&gt;${project.build.packageName}&lt;/packageName&gt;
                &lt;mainClass&gt;${project.build.packageName}.${project.build.className}&lt;/mainClass&gt;
            &lt;/manifest&gt;
            &lt;manifestEntries&gt;
                &lt;Class-Path&gt;.&lt;/Class-Path&gt;
            &lt;/manifestEntries&gt;
        &lt;/archive&gt;
        &lt;finalName&gt;${project.build.targetName}/${project.build.targetName}&lt;/finalName&gt;
    &lt;/configuration&gt;
  &lt;/plugin&gt;
</code></pre>

<p>Which generated the following files:</p>

<pre><code>./lib/axis-2878297.jar
./lib/axis-wsdl4j-1.5.1.jar
./lib/(other dependencies jars)
./target.jar
</code></pre>

<p>1.If I run this jar from command line in this way:</p>

<pre><code>java -jar target.jar
</code></pre>

<p>It produces the exception:</p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: javax/wsdl/OperationType
        at org.apache.axis.description.OperationDesc.&lt;clinit&gt;(OperationDesc.java:59)
        ...
</code></pre>

<p>2.If I run it in the other way:</p>

<pre><code>java -cp "target.jar;lib\*" com.test.Main
</code></pre>

<p>The execution will be successful.</p>

<p><strong>P.S.</strong> I tried to put -verbose:class to the commands.</p>

<p>For case 1 it shows:</p>

<pre><code>[Loaded org.apache.axis.description.OperationDesc from file:/C:/build/lib/axis-2878297.jar]
[Loaded java.lang.Throwable$PrintStreamOrWriter from C:\Program Files\Java\jre1.8.0_74\lib\rt.jar]
[...]
</code></pre>

<p>While for case 2 it shows:</p>

<pre><code>[Loaded org.apache.axis.description.OperationDesc from file:/C:/build/lib/axis-2878297.jar]
[Loaded javax.wsdl.OperationType from file:/C:/build/lib/axis-wsdl4j-1.5.1.jar]
[...]
</code></pre>

<p>What is reason that case 1 fails?</p>

<p>Thanks.</p>