title: Resource is not found in classpath when using maven-assembly plugin
body: <p>I'm using maven assembly to pack an executable jar with its dependencies and resources. The resources (spring application context) are excluded from the jar. When I run <code>mvn assembly:assembly</code>, the tests run and the build succeeds. However, when I run the executable jar after the assemby packaging I get <code>FileNotFoundException</code>. The dependencies such as spring framework that are packed under <code>\lib</code> are found. The resource <code>my-application-context.xml</code> file is also packaged under <code>\lib</code>. Can you please help?</p>
  
  <p>Here is the the POM:</p>
  
  <pre><code>&lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.2.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;descriptors&gt;
                      &lt;descriptor&gt;src/main/assembly/assembly.xml&lt;/descriptor&gt;
                  &lt;/descriptors&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;*.xml&lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/configuration&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;version&gt;2.3.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/*.xml&lt;/exclude&gt;
                  &lt;/excludes&gt;
                  &lt;archive&gt;
                      &lt;manifest&gt;
                          &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                          &lt;classpathPrefix&gt;lib/&lt;/classpathPrefix&gt;
                          &lt;mainClass&gt;com.myapp.MainClass&lt;/mainClass&gt;
                      &lt;/manifest&gt;
                  &lt;/archive&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>
  
  <p>and the descriptor:</p>
  
  <pre><code>&lt;formats&gt;
      &lt;format&gt;zip&lt;/format&gt;
  &lt;/formats&gt;
  &lt;files&gt;
      &lt;file&gt;
          &lt;source&gt;${project.basedir}/src/main/resources/my-application-context.xml&lt;/source&gt;
          &lt;outputDirectory&gt;lib&lt;/outputDirectory&gt;
      &lt;/file&gt;
  &lt;/files&gt;
  &lt;dependencySets&gt;
      &lt;dependencySet&gt;
          &lt;useProjectArtifact&gt;false&lt;/useProjectArtifact&gt;
          &lt;outputDirectory&gt;lib&lt;/outputDirectory&gt;
          &lt;unpack&gt;false&lt;/unpack&gt;
      &lt;/dependencySet&gt;
  &lt;/dependencySets&gt;
  &lt;fileSets&gt;
      &lt;fileSet&gt;
          &lt;directory&gt;${project.build.scriptSourceDirectory}&lt;/directory&gt;
          &lt;outputDirectory&gt;/&lt;/outputDirectory&gt;
          &lt;includes&gt;
              &lt;include&gt;*.bat&lt;/include&gt;
          &lt;/includes&gt;
      &lt;/fileSet&gt;
      &lt;fileSet&gt;
          &lt;directory&gt;${project.build.directory}&lt;/directory&gt;
          &lt;outputDirectory&gt;/&lt;/outputDirectory&gt;
          &lt;includes&gt;
              &lt;include&gt;*.jar&lt;/include&gt;
          &lt;/includes&gt;
      &lt;/fileSet&gt;
  &lt;/fileSets&gt;
  </code></pre>