title: How to create .war file using maven?
body: <p>Here is my project consisting of the following maven modules:</p>
  
  <p>model, services, web</p>
  
  <p>Only web module war file is creating under target folder.<code>.web</code> module consists of controllers and web pages</p>
  
  <p><strong>My pom.xml</strong></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.aitrich.learnware&lt;/groupId&gt;
  &lt;artifactId&gt;Learnware&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;name&gt;Learnware Cloud Application - Master&lt;/name&gt;
  &lt;description&gt;This is parent pom for Learnware Cloud Application, where all the generic configurations are defined.&lt;/description&gt;
  
  &lt;modules&gt;
      &lt;module&gt;LearnwareWeb&lt;/module&gt;
      &lt;module&gt;LearnwareModel&lt;/module&gt;
      &lt;module&gt;LearnwareServices&lt;/module&gt;
  &lt;/modules&gt;
  &lt;organization&gt;
      &lt;name&gt;Aitrich Technologies&lt;/name&gt;
      &lt;url&gt;http://www.aitrich.com&lt;/url&gt;
  &lt;/organization&gt;
  
  &lt;developers&gt;
      &lt;developer&gt;
          &lt;id&gt;1&lt;/id&gt;
          &lt;name&gt;Shaheer&lt;/name&gt;
          &lt;roles&gt;
              &lt;role&gt;Technical Leader&lt;/role&gt;
              &lt;role&gt;Developer&lt;/role&gt;
          &lt;/roles&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;2&lt;/id&gt;
          &lt;name&gt;Shinas&lt;/name&gt;
          &lt;roles&gt;
              &lt;role&gt;Team Leader&lt;/role&gt;
              &lt;role&gt;Developer&lt;/role&gt;
          &lt;/roles&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;3&lt;/id&gt;
          &lt;name&gt;Prasanth AR&lt;/name&gt;
          &lt;roles&gt;
              &lt;role&gt;Developer&lt;/role&gt;
          &lt;/roles&gt;
      &lt;/developer&gt;
      &lt;developer&gt;
          &lt;id&gt;4&lt;/id&gt;
          &lt;name&gt;Jijesh VU&lt;/name&gt;
          &lt;roles&gt;
              &lt;role&gt;Developer&lt;/role&gt;
          &lt;/roles&gt;
      &lt;/developer&gt;
  &lt;/developers&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;javaee6.web.spec.version&gt;2.0.0.Final&lt;/javaee6.web.spec.version&gt;
      &lt;spring.version&gt;3.1.2.RELEASE&lt;/spring.version&gt;
      &lt;hibernate.version&gt;4.1.1.Final&lt;/hibernate.version&gt;
      &lt;junit.version&gt;4.11&lt;/junit.version&gt;
      &lt;java-version&gt;1.7&lt;/java-version&gt;
      &lt;jboss.as.maven.plugin.version&gt;7.4.Final&lt;/jboss.as.maven.plugin.version&gt;
  &lt;/properties&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;springsource-repo&lt;/id&gt;
          &lt;name&gt;SpringSource Repository&lt;/name&gt;
          &lt;url&gt;http://repo.springsource.org/release&lt;/url&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
          &lt;id&gt;jboss-releases-repository&lt;/id&gt;
          &lt;name&gt;JBoss Releases Repository&lt;/name&gt;
          &lt;url&gt;
              https://repository.jboss.org/nexus/content/repositories/releases/
          &lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;jboss-public-repository-group&lt;/id&gt;
          &lt;name&gt;JBoss Public Maven Repository Group&lt;/name&gt;
          &lt;url&gt;https://repository.jboss.org/nexus/content/groups/public-jboss/&lt;/url&gt;
          &lt;layout&gt;default&lt;/layout&gt;
          &lt;releases&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
          &lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;scala-tools.org&lt;/id&gt;
          &lt;name&gt;Scala-Tools Maven2 Repository&lt;/name&gt;
          &lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  
  &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.aitrich.learnware&lt;/groupId&gt;
              &lt;artifactId&gt;LearnwareModel&lt;/artifactId&gt;
              &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.aitrich.learnware&lt;/groupId&gt;
              &lt;artifactId&gt;LearnwareServices&lt;/artifactId&gt;
              &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.aitrich.learnware&lt;/groupId&gt;
              &lt;artifactId&gt;LearnwareWeb&lt;/artifactId&gt;
              &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
              &lt;type&gt;war&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- JBoss distributes a complete set of Java EE 6 APIs including a Bill 
              of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection) 
              of artifacts. We use this here so that we always get the correct versions 
              of artifacts. Here we use the jboss-javaee-web-6.0 stack (you can read this 
              as the JBoss stack of the Java EE Web Profile 6 APIs) --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-javaee-web-6.0&lt;/artifactId&gt;
              &lt;version&gt;${javaee6.web.spec.version}&lt;/version&gt;
              &lt;type&gt;pom&lt;/type&gt;
              &lt;scope&gt;import&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- JSR-303 (Bean Validation) Implementation --&gt;
          &lt;!-- Provides portable constraints such as @Email --&gt;
          &lt;!-- Hibernate Validator is shipped in JBoss AS 7 --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;4.2.0.Final&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Test dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${junit.version}&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.easymock&lt;/groupId&gt;
              &lt;artifactId&gt;easymock&lt;/artifactId&gt;
              &lt;version&gt;3.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;joda-time&lt;/groupId&gt;
              &lt;artifactId&gt;joda-time&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.lowagie&lt;/groupId&gt;
              &lt;artifactId&gt;itext&lt;/artifactId&gt;
              &lt;version&gt;2.1.7&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  
  &lt;build&gt;
  &lt;directory&gt;${project.basedir}/target&lt;/directory&gt; 
      &lt;pluginManagement&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;configuration&gt;
                      &lt;source&gt;${java-version}&lt;/source&gt;
                      &lt;target&gt;${java-version}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;!--Plugin for JBossAs7 --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.jboss.as.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;jboss-as-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${jboss.as.maven.plugin.version}&lt;/version&gt;
                  &lt;inherited&gt;true&lt;/inherited&gt;
                  &lt;configuration&gt;
                      &lt;hostname&gt;localhost&lt;/hostname&gt;
                      &lt;port&gt;9999&lt;/port&gt;
                      &lt;filename&gt;${project.build.finalName}.war&lt;/filename&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;deploy&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>