title: maven to package app jar, create project classpath, goals
body: <p><strong>Update</strong> : solved by using assembly plugin to copy in artifacts, to a folder or create a redistributable zip file.
  Do not know maven. Used STS/ eclipse to make a maven project that is a swing standalone application. App runs fine inside STS. <a href="https://github.com/rfkrocktk/maven-assembly-example/releases" rel="nofollow">Example helped.</a>
  {figured out how it's  getting the runner script. template is there in the source. maven just filters it and puts the current jar name. Now just need to figure out how to stop maving putting my app jar in the assembly lib (want it one level up so can click it and start, and 80 other jars are in lib), using ant for that now }</p>
  
  <p><em>Original question</em>
  Cannot find the lib folder. Apparently the app refers to local jars in the maven local repo.</p>
  
  <p>Can I tell maven to copy them to some folder under my project like dist/lib and make a full app jar in my dist/ (I do not care if dist is some other directory name -> if there is a maven default do not mind that). I want a distributable set of jars to ship.</p>
  
  <p>When I build my project now it puts classes in the </p>
  
  <blockquote>
    <p>./target/classes</p>
  </blockquote>
  
  <p>directory ./ is my project folder here</p>
  
  <p>My pom:-</p>
  
  <p><code></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;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;com.selenium&lt;/groupId&gt;
  
  &lt;artifactId&gt;SA&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  &lt;name&gt;SA&lt;/name&gt;
  &lt;url&gt;http://sel2in.com&lt;/url&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.james&lt;/groupId&gt;
          &lt;artifactId&gt;apache-mime4j&lt;/artifactId&gt;
          &lt;version&gt;0.6.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.beanshell&lt;/groupId&gt;
          &lt;artifactId&gt;bsh&lt;/artifactId&gt;
          &lt;version&gt;1.3.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;cglib&lt;/groupId&gt;
          &lt;artifactId&gt;cglib-nodep&lt;/artifactId&gt;
          &lt;version&gt;2.1_3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-codec&lt;/groupId&gt;
          &lt;artifactId&gt;commons-codec&lt;/artifactId&gt;
          &lt;version&gt;1.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-collections&lt;/groupId&gt;
          &lt;artifactId&gt;commons-collections&lt;/artifactId&gt;
          &lt;version&gt;3.2.1&lt;/version&gt;
  
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-exec&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;commons-io&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;2.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;commons-jxpath&lt;/groupId&gt;
          &lt;artifactId&gt;commons-jxpath&lt;/artifactId&gt;
          &lt;version&gt;1.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-logging&lt;/groupId&gt;
          &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
          &lt;version&gt;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.sourceforge.cssparser&lt;/groupId&gt;
          &lt;artifactId&gt;cssparser&lt;/artifactId&gt;
          &lt;version&gt;0.9.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;dom4j&lt;/groupId&gt;
          &lt;artifactId&gt;dom4j&lt;/artifactId&gt;
          &lt;version&gt;1.6.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
          &lt;artifactId&gt;guava&lt;/artifactId&gt;
          &lt;version&gt;14.0-rc1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
          &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt;
          &lt;version&gt;1.3.RC2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
          &lt;artifactId&gt;hamcrest-library&lt;/artifactId&gt;
          &lt;version&gt;1.3.RC2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.sourceforge.htmlunit&lt;/groupId&gt;
          &lt;artifactId&gt;htmlunit&lt;/artifactId&gt;
          &lt;version&gt;2.12&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.sourceforge.htmlunit&lt;/groupId&gt;
          &lt;artifactId&gt;htmlunit-core-js&lt;/artifactId&gt;
          &lt;version&gt;2.12&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.2.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpcore&lt;/artifactId&gt;
          &lt;version&gt;4.2.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpmime&lt;/artifactId&gt;
          &lt;version&gt;4.2.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.ini4j&lt;/groupId&gt;
          &lt;artifactId&gt;ini4j&lt;/artifactId&gt;
          &lt;version&gt;0.5.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.beust&lt;/groupId&gt;
          &lt;artifactId&gt;jcommander&lt;/artifactId&gt;
          &lt;version&gt;1.29&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.jetty.aggregate&lt;/groupId&gt;
          &lt;artifactId&gt;jetty-websocket&lt;/artifactId&gt;
          &lt;version&gt;8.1.8.v20121106&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.java.dev.jna&lt;/groupId&gt;
          &lt;artifactId&gt;jna&lt;/artifactId&gt;
          &lt;version&gt;3.4.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.java.dev.jna&lt;/groupId&gt;
          &lt;artifactId&gt;platform&lt;/artifactId&gt;
          &lt;version&gt;3.4.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.json&lt;/groupId&gt;
          &lt;artifactId&gt;json&lt;/artifactId&gt;
          &lt;version&gt;20080701&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.8.2&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;1.2.13&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.sourceforge.nekohtml&lt;/groupId&gt;
          &lt;artifactId&gt;nekohtml&lt;/artifactId&gt;
          &lt;version&gt;1.9.17&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.netty&lt;/groupId&gt;
          &lt;artifactId&gt;netty&lt;/artifactId&gt;
          &lt;version&gt;3.5.7.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.opera&lt;/groupId&gt;
          &lt;artifactId&gt;operadriver&lt;/artifactId&gt;
          &lt;version&gt;1.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.detro.ghostdriver&lt;/groupId&gt;
          &lt;artifactId&gt;phantomjsdriver&lt;/artifactId&gt;
          &lt;version&gt;1.0.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi&lt;/artifactId&gt;
          &lt;version&gt;3.8&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
          &lt;version&gt;3.8&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
          &lt;artifactId&gt;selenium-firefox-driver&lt;/artifactId&gt;
          &lt;version&gt;2.33.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-ooxml-schemas&lt;/artifactId&gt;
          &lt;version&gt;3.8&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-scratchpad&lt;/artifactId&gt;
          &lt;version&gt;3.8&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.protobuf&lt;/groupId&gt;
          &lt;artifactId&gt;protobuf-java&lt;/artifactId&gt;
          &lt;version&gt;2.4.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.w3c.css&lt;/groupId&gt;
          &lt;artifactId&gt;sac&lt;/artifactId&gt;
          &lt;version&gt;1.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
          &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
          &lt;version&gt;2.33.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xalan&lt;/groupId&gt;
          &lt;artifactId&gt;serializer&lt;/artifactId&gt;
          &lt;version&gt;2.7.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;stax&lt;/groupId&gt;
          &lt;artifactId&gt;stax-api&lt;/artifactId&gt;
          &lt;version&gt;1.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xalan&lt;/groupId&gt;
          &lt;artifactId&gt;xalan&lt;/artifactId&gt;
          &lt;version&gt;2.7.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xerces&lt;/groupId&gt;
          &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
          &lt;version&gt;2.10.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xml-apis&lt;/groupId&gt;
          &lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
          &lt;version&gt;1.4.01&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.xmlbeans&lt;/groupId&gt;
          &lt;artifactId&gt;xmlbeans&lt;/artifactId&gt;
          &lt;version&gt;2.3.0&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-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.14.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;skipTests&gt;false&lt;/skipTests&gt;
                  &lt;failIfNoTests&gt;false&lt;/failIfNoTests&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;3.1&lt;/version&gt;
              &lt;configuration&gt;
  
                  &lt;!-- put your configurations here --&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>
  </code></p>
  
  <p>Did as Andreas suggested Added shade to pom :-</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;!-- put your configurations here --&gt;
                  &lt;transformers&gt;
              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer"&gt;
                  &lt;resource&gt;.txt&lt;/resource&gt;
                  &lt;resource&gt;resources/&lt;/resource&gt;
              &lt;/transformer&gt;
            &lt;/transformers&gt;
  
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;shade&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>From IDE build :</p>
  
  <p>Dont see anything</p>
  
  <p>From command line if I give </p>
  
  <pre><code>mvn package  shade:shade 
  </code></pre>
  
  <p>Then :-</p>
  
  <pre><code>[INFO] Including org.seleniumhq.selenium:selenium-safari-driver:jar:2.33.0 in the shaded jar.
  [INFO] Including org.seleniumhq.selenium:selenium-support:jar:2.33.0 in the shaded jar.
  [INFO] Including org.webbitserver:webbit:jar:0.4.14 in the shaded jar.
  [INFO] Including xalan:serializer:jar:2.7.1 in the shaded jar.
  [INFO] Including stax:stax-api:jar:1.0.1 in the shaded jar.
  [INFO] Including xalan:xalan:jar:2.7.1 in the shaded jar.
  [INFO] Including xerces:xercesImpl:jar:2.10.0 in the shaded jar.
  [INFO] Including xml-apis:xml-apis:jar:1.4.01 in the shaded jar.
  [INFO] Including org.apache.xmlbeans:xmlbeans:jar:2.3.0 in the shaded jar.
  [DEBUG] Processing JAR /Users/manoj/Downloads/SA/target/SA-0.0.1-SNAPSHOT.jar
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 9.873s
  [INFO] Finished at: Sat Jul 06 22:08:17 GMT+05:30 2013
  [INFO] Final Memory: 20M/81M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default-cli) on project SA: Error creating shaded jar: Invalid signature file digest for Manifest main attributes -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default-cli) on project SA: Error creating shaded jar: Invalid signature file digest for Manifest main attributes
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating shaded jar: Invalid signature file digest for Manifest main attributes
      at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:528)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
  Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
      at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:221)
      at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:176)
      at java.util.jar.JarVerifier.processEntry(JarVerifier.java:288)
      at java.util.jar.JarVerifier.update(JarVerifier.java:199)
      at java.util.jar.JarFile.initializeVerifier(JarFile.java:323)
      at java.util.jar.JarFile.getInputStream(JarFile.java:388)
      at org.apache.maven.plugins.shade.DefaultShader.shade(DefaultShader.java:146)
      at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:458)
      ... 21 more
  [ERROR] 
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>Used assembly (suggested by John Ament) as described here <a href="https://github.com/rfkrocktk/maven-assembly-example/releases" rel="nofollow" title="github sample on using assembly">maven-assembly-example/releases</a> or <a href="https://github.com/rfkrocktk/maven-assembly-example/archive/1.0.0.zip" rel="nofollow" title="zip to sample assembly project on github">zip</a></p>
  
  <p>Got a big tar and zip with all the jars. Most of the work done. Now just need to unpack, make a script so I have</p>
  
  <pre><code> project-home
     -&gt; dist
     --&gt;   MyApp.jar
     --&gt; lib
     ---&gt;  other1.jar
     ---&gt;  other2.jar
     --&gt; conf
     ---&gt;  myResources1.jpg
     ---&gt;  otherFiles2.xyz
  </code></pre>