title: Java not able to find dependencies while executing executable jar generated with maven-jar-pluin configured with exact classpath arguments
body: <p>The following is the directory structure of my java application:</p>
  
  <pre><code>application.jar
  dependency-jars
       a.jar
       b.jar
       c.jar
  </code></pre>
  
  <p>The application executes fine when I use the following command: <code>java -cp "application.jar;dependency-jars/*" com.my.Application</code>. In addition to application dependencies, 'dependency-jars' folder will also have jars dropped by its consumers. I want to make it an executable jar so as to make it easy for its consumers to invoke it. For creating executable jar I am making use of maven jar plugin. I want to simulate the above command line. I used the following maven jar plugin configuration:</p>
  
  <pre><code>&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.4&lt;/version&gt;
     &lt;configuration&gt;
        &lt;archive&gt;
           &lt;manifest&gt;
              &lt;mainClass&gt;com.my.Application&lt;/mainClass&gt;
              &lt;addClasspath&gt;true&lt;/addClasspath&gt;
           &lt;/manifest&gt;
           &lt;manifestEntries&gt;
              &lt;Class-Path&gt;dependency-jars/*&lt;/Class-Path&gt;
           &lt;/manifestEntries&gt;
        &lt;/archive&gt;
     &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>The generated jar when executed is not able to find its dependencies at run time. Is there anything wrong with the above.</p>
  
  <p>Thanks.</p>