title: maven jetty embedded (fat jar) - src/main/webapp missing in jar
body: <p>I am trying to built a embedded jetty in one fat jar. I built the app using a tuto for jetty-embedded offering rest service, which I also need in my application. Now I am trying to add/include a jsf based context. Everything works fine in Eclipse, but as soon as deploy using maven clean install and I try to execute the jar somewhere esle, I get the following error:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalArgumentException: file:///home/debbie/src/main/webapp is not an existing directory.
        at org.eclipse.jetty.util.resource.ResourceCollection.(ResourceCollection.java:108)
        at com.example.haaa.server.App.start(App.java:43)
        at com.example.haaa.server.App.main(App.java:62)</p>
  </blockquote>
  
  <p>I checked the jar and it doesnt contain none of the webapp resources, but I do not understand how I can tell maven to include those files into the jar, or how I can solve my issue.</p>
  
  <p>Following my simplified pom.xml (got rid of dependencies here, as I dont expect that to be any matter.</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.example&lt;/groupId&gt;
    &lt;artifactId&gt;haaa&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;haaa&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;prime-repo&lt;/id&gt;
              &lt;name&gt;Prime Repo&lt;/name&gt;
              &lt;url&gt;http://repository.primefaces.org&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
  
    &lt;build&gt;
      &lt;resources&gt;
      &lt;resource&gt;
          &lt;directory&gt;src/main/resources&lt;/directory&gt;
      &lt;/resource&gt;
      &lt;resource&gt;
          &lt;directory&gt;src/main/webapp&lt;/directory&gt;
      &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
        &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;1.6&lt;/version&gt;
          &lt;configuration&gt;
            &lt;createDependencyReducedPom&gt;true&lt;/createDependencyReducedPom&gt;
            &lt;filters&gt;
              &lt;filter&gt;
                &lt;artifact&gt;*:*&lt;/artifact&gt;
                &lt;excludes&gt;
                  &lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
                  &lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
                  &lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
                &lt;/excludes&gt;
              &lt;/filter&gt;
            &lt;/filters&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;configuration&gt;
                &lt;transformers&gt;
                  &lt;transformer
                    implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /&gt;
                  &lt;transformer
                    implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                    &lt;manifestEntries&gt;
                      &lt;Main-Class&gt;com.example.haaa.server.App&lt;/Main-Class&gt;
                    &lt;/manifestEntries&gt;
                  &lt;/transformer&gt;
                &lt;/transformers&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>And following the code in my com.example.haaa.server.App:</p>
  
  <pre><code>package com.example.haaa.server;
  
  import java.util.HashMap;
  import java.util.Map;
  
  import org.apache.log4j.Logger;
  import org.eclipse.jetty.security.HashLoginService;
  import org.eclipse.jetty.server.Server;
  import org.eclipse.jetty.server.handler.HandlerCollection;
  import org.eclipse.jetty.servlet.ServletHolder;
  import org.eclipse.jetty.util.resource.ResourceCollection;
  import org.eclipse.jetty.webapp.WebAppContext;
  import org.glassfish.jersey.servlet.ServletContainer;
  
  import com.example.haaa.service.AbuseService;
  
  public class App {
  
      final static Logger logger = Logger.getLogger(App.class);
  
      private final Server server;
  
      public App() {
          server = new Server(8080);
      }
  
      public void start() throws Exception {    
          // REST
          WebAppContext restHandler = new WebAppContext();
  
          restHandler.setResourceBase("./");
          restHandler.setClassLoader(Thread.currentThread().getContextClassLoader());
  
          ServletHolder restServlet = restHandler.addServlet(ServletContainer.class,  "/abuse/*");
          restServlet.setInitOrder(0);
          Map&lt;String, String&gt; initparams = new HashMap&lt;String, String&gt;();
          initparams.put("jersey.config.server.provider.classnames", AbuseService.class.getCanonicalName()+","+"org.glassfish.jersey.filter.LoggingFilter;org.glassfish.jersey.moxy.json.MoxyFeature;org.glassfish.jersey.media.multipart.MultiPartFeature");
          restServlet.setInitParameters(initparams);
          // Web
          WebAppContext webHandler = new WebAppContext();
          webHandler.setResourceAlias("/WEB-INF/classes/", "/classes/");
          webHandler.setBaseResource(
                  new ResourceCollection(
                      new String[] { "./src/main/webapp", "./target" }));
          webHandler.setContextPath("/web/");
  
          HashLoginService loginService = new HashLoginService("HaaaRealm");
          loginService.setConfig("./src/main/webapp/loginrealm.txt");
          System.out.println(loginService.getConfig());
          server.addBean(loginService);
  
          // Server
          HandlerCollection handlers = new HandlerCollection();
          handlers.addHandler(webHandler);
          handlers.addHandler(restHandler);
  
          server.setHandler(handlers);
          server.start();
      }
  
      public static void main(String[] args) throws Exception {
          new App().start();
      }
  }
  </code></pre>
  
  <p>If I should have left out any relevant information, please let me know.</p>