title: application.xml does not exist. error during maven EAR build
body: <p>I am trying to build an ear project with two war files inside. While building the EAR I am getting the error as "application.xml does not exist". But I have placed the application.xml in the projects META INF folder. Please find the code below. and suggest a solution to resolve this.</p>
  
  <p>Below Is my POM.XML</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;au.com.mercury&lt;/groupId&gt;
    &lt;artifactId&gt;ReplenishmentR4&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;ear&lt;/packaging&gt;
    &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.6&lt;/version&gt;
        &lt;configuration&gt;
          &lt;applicationXML&gt;src/main/application/META-INF/application.xml&lt;/applicationXML&gt;
          &lt;generateApplicationXml&gt;false&lt;/generateApplicationXml&gt;
          &lt;encoding&gt;UTF-8&lt;/encoding&gt;
          &lt;defaultLibBundleDir&gt;lib/&lt;/defaultLibBundleDir&gt;
          &lt;filtering&gt;true&lt;/filtering&gt;
          &lt;modules&gt;
            &lt;webModule&gt;
              &lt;groupId&gt;au.com.mercury&lt;/groupId&gt;
              &lt;artifactId&gt;Replenishment&lt;/artifactId&gt;
              &lt;bundleFileName&gt;Replenishment.war&lt;/bundleFileName&gt;
            &lt;/webModule&gt;
            &lt;webModule&gt;
              &lt;groupId&gt;au.com.mercury&lt;/groupId&gt;
              &lt;artifactId&gt;ReplenishmentR3&lt;/artifactId&gt;
              &lt;bundleFileName&gt;ReplenishmentR3.war&lt;/bundleFileName&gt;
            &lt;/webModule&gt;
          &lt;/modules&gt;
        &lt;/configuration&gt;
      &lt;/plugin&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.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
    &lt;/plugins&gt;
     &lt;finalName&gt;ReplenishmentR4&lt;/finalName&gt;
  &lt;/build&gt;
  
  &lt;dependencies&gt;
  
    &lt;dependency&gt;
      &lt;groupId&gt;au.com.mercury&lt;/groupId&gt;
      &lt;artifactId&gt;Replenishment&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;type&gt;war&lt;/type&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;au.com.mercury&lt;/groupId&gt;
      &lt;artifactId&gt;ReplenishmentR3&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;type&gt;war&lt;/type&gt;
    &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Below is my application.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;application&gt;
    &lt;module&gt;
      &lt;web&gt;
        &lt;web-uri&gt;Replenishment.war&lt;/web-uri&gt;
        &lt;context-root&gt;/Replenishment&lt;/context-root&gt;
      &lt;/web&gt;
    &lt;/module&gt;
    &lt;module&gt;
      &lt;web&gt;
        &lt;web-uri&gt;ReplenishmentR3.war&lt;/web-uri&gt;
        &lt;context-root&gt;/ReplenishmentR2&lt;/context-root&gt;
      &lt;/web&gt;
    &lt;/module&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>Open This Image for the project structure.</p>
  
  <p><a href="https://i.stack.imgur.com/H3UHm.png" rel="nofollow noreferrer">Project structure</a></p>
  
  <p>Maven build console error:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building ReplenishmentR4 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [WARNING] The POM for au.com.woolworths.mercury:ReplenishmentR3:war:0.0.1-SNAPSHOT is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
  [INFO] 
  [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ ReplenishmentR4 ---
  [INFO] Deleting C:\Users\xagh9\workspace\ReplenishmentR4\target
  [INFO] 
  [INFO] --- maven-ear-plugin:2.6:generate-application-xml (default-generate-application-xml) @ ReplenishmentR4 ---
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ReplenishmentR4 ---
  [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] skip non existing resourceDirectory C:\Users\xagh9\workspace\ReplenishmentR4\src\main\resources
  [INFO] 
  [INFO] --- maven-ear-plugin:2.6:ear (default-ear) @ ReplenishmentR4 ---
  [INFO] Copying artifact[war:au.com.mercury:Replenishment:0.0.1-SNAPSHOT] to[Replenishment.war]
  [INFO] Copying artifact[war:au.com.mercury:ReplenishmentR3:0.0.1-SNAPSHOT] to[ReplenishmentR3.war]
  [INFO] Copy ear sources to C:\Users\xagh9\workspace\ReplenishmentR4\target\ReplenishmentR4
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 6.177 s
  [INFO] Finished at: 2016-12-24T22:33:03+11:00
  [INFO] Final Memory: 12M/164M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.6:ear (default-ear) on project ReplenishmentR4: Deployment descriptor: C:\Users\xagh9\workspace\ReplenishmentR4\target\ReplenishmentR4\META-INF\application.xml does not exist. -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>