title: maven-ear-plugin is not including jarModule into application.xml
body: <p>I've been following the example on the maven-ear-plugin site that <a href="http://maven.apache.org/plugins/maven-ear-plugin/examples/including-a-third-party-library-in-application-xml.html">shows how to add third-party libraries to the generated application.xml</a>. However, it does not appear to be working as I expected. Similarly the web module <a href="http://maven.apache.org/plugins/maven-ear-plugin/modules.html#webModule">contextRoot</a> is being ignored.</p>
  
  <p>According to the <a href="http://maven.apache.org/plugins/maven-ear-plugin/usage.html#Advanced_Configuration">documentation</a> what I am trying to do should be entirely possible.</p>
  
  <blockquote>
    <p><strong>The context root of a Web module might be customized using the
    contextRoot parameter.</strong></p>
    
    <p>Please note that third party libraries (i.e. JarModule) are not
    included in the generated application.xml (only ejb-client should be
    included in a java entry). However, <strong>a jar dependency could be included
    in the generated application.xml by specifying the
    includeInApplicationXml flag</strong>.</p>
  </blockquote>
  
  <p>I have the following output when it executes the build in my application.xml.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE application PUBLIC
      "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
      "http://java.sun.com/dtd/application_1_3.dtd"&gt;
  &lt;application&gt;
    &lt;display-name&gt;MyApp.EAR&lt;/display-name&gt;
    &lt;module&gt;
      &lt;ejb&gt;MyApp.jar&lt;/ejb&gt;
    &lt;/module&gt;
    &lt;module&gt;
      &lt;web&gt;
        &lt;web-uri&gt;MyApp.war&lt;/web-uri&gt;
        &lt;context-root&gt;/MyApp.Web&lt;/context-root&gt;
      &lt;/web&gt;
    &lt;/module&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>From the following maven configuraton (pom.xml).</p>
  
  <pre><code>...
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.blah&lt;/groupId&gt;
  &lt;artifactId&gt;MyApp.EAR&lt;/artifactId&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  &lt;packaging&gt;ear&lt;/packaging&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;maven-ear-plugin&lt;/groupId&gt;
              &lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.7&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;applicationName&gt;MyApp&lt;/applicationName&gt;
                  &lt;modules&gt;
                      &lt;ejbModule&gt;
                          &lt;groupId&gt;com.blah&lt;/groupId&gt;
                          &lt;artifactId&gt;MyApp.EJB&lt;/artifactId&gt;
                      &lt;/ejbModule&gt;
                      &lt;webModule&gt;
                          &lt;groupId&gt;com.blah&lt;/groupId&gt;
                          &lt;artifactId&gt;MyApp.Web&lt;/artifactId&gt;
                          &lt;contextRoot&gt;MyApp&lt;/contextRoot&gt;
                      &lt;/webModule&gt;
                      &lt;jarModule&gt;
                          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                          &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
                          &lt;includeLibInApplicationXml&gt;true&lt;/includeLibInApplicationXml&gt;
                      &lt;/jarModule&gt;
                  &lt;/modules&gt;
                  &lt;archive&gt;
                      &lt;manifestEntries&gt;
                          &lt;WebLogic-Application-Version&gt;${weblogic.version}&lt;/WebLogic-Application-Version&gt;
                      &lt;/manifestEntries&gt;
                  &lt;/archive&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;dependencies&gt;
      &lt;!-- web and ejb modules --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.blah&lt;/groupId&gt;
          &lt;artifactId&gt;MyApp.EJB&lt;/artifactId&gt;
          &lt;version&gt;1.0&lt;/version&gt;
          &lt;type&gt;ejb&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.blah&lt;/groupId&gt;
          &lt;artifactId&gt;MyApp.Web&lt;/artifactId&gt;
          &lt;version&gt;1.0&lt;/version&gt;
          &lt;type&gt;war&lt;/type&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  ...
  </code></pre>
  
  <p>It is immediately obvious that the application.xml is not being generated as I intended.</p>
  
  <ol>
  <li>The contextRoot supplied is not correct in the application.xml, instead the default name of MyApp.Web is output instead of the specified MyApp.</li>
  <li>The org.slf4j jarModule specified is missing entirely from the application.xml.</li>
  </ol>
  
  <p>What am I doing wrong?</p>
  
  <p>Debug from Maven is shown below.</p>
  
  <pre><code>[DEBUG] -----------------------------------------------------------------------
  [DEBUG] Goal:          org.apache.maven.plugins:maven-ear-plugin:2.4.2:generate-application-xml (default-generate-application-xml)
  [DEBUG] Style:         Regular
  [DEBUG] Configuration: &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
    &lt;description&gt;${project.description}&lt;/description&gt;
    &lt;displayName&gt;${project.artifactId}&lt;/displayName&gt;
    &lt;encoding default-value="UTF-8"/&gt;
    &lt;generatedDescriptorLocation&gt;${project.build.directory}&lt;/generatedDescriptorLocation&gt;
    &lt;includeLibInApplicationXml default-value="false"/&gt;
    &lt;project&gt;${project}&lt;/project&gt;
    &lt;version default-value="1.3"/&gt;
    &lt;workDirectory&gt;${project.build.directory}/${project.build.finalName}&lt;/workDirectory&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>P.S. I tried creating the maven-ear-plugin tag, but it would not let me as I am not reputable enough! If someone could create that I would be grateful.</p>