title: Tomcat - maven - how to add the static pages to the WAR file?
body: <p>When building the WAR file (for Tomcat) via Maven the static pages are not added. I can see that in other Eclipse projects (created with another artififact?) the web pages are automatically added to the WAR. </p>
  
  <p>When I add manually to the Eclipse config file 'org.eclipse.wst.common.component' the following lines then the static files are added to the war. </p>
  
  <pre><code>&lt;wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/&gt;
  &lt;wb-resource deploy-path="/" source-path="/src/main/webapp"/&gt;
  </code></pre>
  
  <p>HOW can I have the static pages added using a Maven script (clean install? Then I am not dependent on a specific IDE settings file. </p>
  
  <p>[1] The src/main/webapp/WEB-INF/web.xml file is: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns="http://java.sun.com/xml/ns/javaee" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
     http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
     id="WebApp_ID" version="3.0"&gt;
     &lt;display-name&gt;User Management&lt;/display-name&gt;
     &lt;servlet&gt;
        &lt;servlet-name&gt;Jersey RESTful Application&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
           &lt;init-param&gt;
              &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
              &lt;param-value&gt;nl.deholtmans.Restfull01UserManagement&lt;/param-value&gt;
           &lt;/init-param&gt;
        &lt;/servlet&gt;
     &lt;servlet-mapping&gt;
     &lt;servlet-name&gt;Jersey RESTful Application&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
     &lt;/servlet-mapping&gt;
     &lt;!-- NOTICE: the next lines make no difference
     &lt;servlet-name&gt;default&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
     &lt;/servlet-mapping&gt; --&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>[2] The html files are in the folder 'WebContent' (under the Eclipse project). I also tried to put them under src/main/webapp</p>
  
  <p>[3] The pom.xml file is: </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/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;nl.xyz&lt;/groupId&gt;
    &lt;artifactId&gt;RestJerseyJquery2&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;RestJerseyJquery2 Maven Webapp&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;build&gt;
          &lt;finalName&gt;RestJerseyJquery2&lt;/finalName&gt;
          &lt;plugins&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;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.glassfish.maven.plugin&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-glassfish-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;glassfishDirectory&gt;${local.glassfish.home}&lt;/glassfishDirectory&gt;
                      &lt;user&gt;admin&lt;/user&gt;
                      &lt;passwordFile&gt;${local.glassfish.passfile}&lt;/passwordFile&gt;
                      &lt;domain&gt;
                          &lt;name&gt;domain1&lt;/name&gt;
                          &lt;httpPort&gt;8080&lt;/httpPort&gt;
                          &lt;adminPort&gt;4848&lt;/adminPort&gt;
                      &lt;/domain&gt;
                      &lt;components&gt;
                          &lt;component&gt;
                              &lt;name&gt;${project.artifactId}&lt;/name&gt;
                              &lt;artifact&gt;target/${project.build.finalName}.war&lt;/artifact&gt;
                          &lt;/component&gt;
                      &lt;/components&gt;
                      &lt;debug&gt;true&lt;/debug&gt;
                      &lt;terse&gt;false&lt;/terse&gt;
                      &lt;echo&gt;true&lt;/echo&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.glassfish.jersey&lt;/groupId&gt;
                  &lt;artifactId&gt;jersey-bom&lt;/artifactId&gt;
                  &lt;version&gt;${jersey.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt; 
              &lt;groupId&gt;javax.json&lt;/groupId&gt; 
              &lt;artifactId&gt;javax.json-api&lt;/artifactId&gt; 
              &lt;version&gt;1.0&lt;/version&gt; 
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt; 
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt; 
              &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt; 
              &lt;version&gt;7.0&lt;/version&gt; 
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-container-servlet-core&lt;/artifactId&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.17&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!--  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.40&lt;/version&gt;
          &lt;/dependency&gt;  --&gt;
  
          &lt;!-- &lt;dependency&gt;
              &lt;groupId&gt;org.xerial&lt;/groupId&gt;
              &lt;artifactId&gt;sqlite-jdbc&lt;/artifactId&gt;
              &lt;version&gt;3.8.11.2&lt;/version&gt;
          &lt;/dependency&gt;--&gt;
  
          &lt;!-- JSON support--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-media-moxy&lt;/artifactId&gt;
          &lt;/dependency&gt; 
      &lt;/dependencies&gt;
      &lt;properties&gt;
          &lt;jersey.version&gt;2.22&lt;/jersey.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>