title: Maven: Making Jars With Dependencies: Example From Book Doesn't Work
body: <p>I am a complete beginner with Maven.  I've been following the book <a href="http://www.sonatype.com/books/mvnex-book/reference/customizing-sect-custom-packaged.html">Maven By Example</a>.  In the section 6.13 the author demonstrates making a JAR with the dependencies included via the command</p>
  
  <pre><code>mvn install assembly assembly
  </code></pre>
  
  <p>I followed the example in chapter 6, except I skipped the parts with unit testing.  I went back through them to make sure I didn't skip a step.  However when I tried the above command I got this error output:</p>
  
  <pre><code>[INFO]
  [INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ simple-weather ---
  [INFO]
  [INFO] &lt;&lt;&lt; maven-assembly-plugin:2.2-beta-5:assembly (default-cli) @ simple-weather &lt;&lt;&lt;
  [INFO]
  [INFO] --- maven-assembly-plugin:2.2-beta-5:assembly (default-cli) @ simple-weather ---
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.094s
  [INFO] Finished at: Wed Mar 21 15:53:03 EDT 2012
  [INFO] Final Memory: 5M/10M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:assembly (default-cli) on project simple-weather: Error readi
  ng assemblies: No assembly descriptors found. -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [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
  C:\home\Projects\simple-weather&gt;
  </code></pre>
  
  <p>The problem is with the jar-with-dependencies descriptor in the plugins section.  I googled around a bit, but didn't find a different way to do it from the book.   So, I would be interested to know where I am going wrong.   </p>
  
  <p>Here is my pom.xml:</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;org.sonatype.mavenbook.custom&lt;/groupId&gt;
      &lt;artifactId&gt;simple-weather&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;simple-weather&lt;/name&gt;
      &lt;url&gt;http://www.sonatype.com&lt;/url&gt;
  
  
      &lt;licenses&gt;
          &lt;license&gt;
              &lt;name&gt;Apache 2&lt;/name&gt;
              &lt;url&gt;http://www.apache.org/licenses/LICENSE-2.0.txt&lt;/url&gt;
              &lt;distribution&gt;repo&lt;/distribution&gt;
              &lt;comments&gt;A business-friendly OSS license&lt;/comments&gt;
          &lt;/license&gt;
      &lt;/licenses&gt;
  
      &lt;organization&gt;
          &lt;name&gt;Sonatype&lt;/name&gt;
          &lt;url&gt;http://www.sonatype.com&lt;/url&gt;
      &lt;/organization&gt;
  
      &lt;developers&gt;
          &lt;developer&gt;
              &lt;id&gt;jason&lt;/id&gt;
              &lt;name&gt;Jason Van Zyl&lt;/name&gt;
              &lt;email&gt;jason@maven.org&lt;/email&gt;
              &lt;url&gt;http://www.sonatype.com&lt;/url&gt;
              &lt;organization&gt;Sonatype&lt;/organization&gt;
              &lt;organizationUrl&gt;http://www.sonatype.com&lt;/organizationUrl&gt;
              &lt;roles&gt;
                  &lt;role&gt;developer&lt;/role&gt;
              &lt;/roles&gt;
              &lt;timezone&gt;-6&lt;/timezone&gt;
          &lt;/developer&gt;
      &lt;/developers&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;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.14&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;jaxen&lt;/groupId&gt;
              &lt;artifactId&gt;jaxen&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;velocity&lt;/groupId&gt;
              &lt;artifactId&gt;velocity&lt;/artifactId&gt;
              &lt;version&gt;1.5&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;3.8.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.5&lt;/source&gt;
                      &lt;target&gt;1.5&lt;/target&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  
  
  
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Thanks much in advance for any clues.</p>