title: How to create a complete `.war` file with pom.xml
body: <p>I have a web service project (SOAP) implemented in Java, as a Maven project. I want to create a <code>.war</code> to deploy into a Tomcat.</p>
  
  <p>To create the <code>.war</code>, I always used the Eclipse Juno interface (Right click -> Export -> WAR File). The Eclipse is configured with Tomcat 7 and Axis 1.5.6. Using this method I deploy the <code>.war</code> file created and everything is fine! The main page of the application looks like below:</p>
  
  <p>[![Web Service main page][1]][1]</p>
  
  <p>In this page, I can explore the services, methods and WSDL files. This is what I call <strong>complete <code>.war</code> file.</strong></p>
  
  <p>Now, I migrated my web service to Maven, in order to use it with Jenkins, to automate the deploys, tests, etc.</p>
  
  <p>I tried for two full days create a <code>pom.xml</code> which will create the same <code>.war</code> file that was created with Eclipse, but I was not successful. When I deploy the <code>.war</code> created using the <code>pom.xml</code> on a Tomcat and access the <code>localhost:8080/SOAPExample/</code>, it shows <em>Error 404</em>. The Maven build of the <code>.war</code> and the Tomcat deploy was successful. I understood that the service page was not created, but the web service was deployed successfuly.</p>
  
  <p>I used some of the tutorials available in the internet, like the below, but in all cases the <code>.war</code> created by Maven is incomplete:</p>
  
  <p><a href="http://crunchify.com/how-to-create-a-war-file-from-eclipse-using-maven-plugin-apache-maven-war-plugin-usage/" rel="nofollow noreferrer">http://crunchify.com/how-to-create-a-war-file-from-eclipse-using-maven-plugin-apache-maven-war-plugin-usage/</a></p>
  
  <p><a href="https://www.mkyong.com/maven/how-to-deploy-maven-based-war-file-to-tomcat/" rel="nofollow noreferrer">https://www.mkyong.com/maven/how-to-deploy-maven-based-war-file-to-tomcat/</a></p>
  
  <p>It looks like I'm missing some dependency configuration into the <code>pom.xml</code>, or something like that. Here is my <code>pom.xml</code>. I also think it is missing some axis2 configuration.</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.test&lt;/groupId&gt;
  &lt;artifactId&gt;SOAPExample&lt;/artifactId&gt;
  &lt;version&gt;0.0.1&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;name&gt;SOAPExample&lt;/name&gt;
  &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
          &lt;plugin&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;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
                  &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is my project sctructure:</p>
  
  <p>[[![Project Folder Structure]][2][2]]</p>
  
  <p>There is no tutorial in the internet explaining how to configure a <code>pom.xml</code> to create a <strong>complete</strong> <code>.war</code> file. Could some good soul help me?</p>