# Unable to add same webModule with different contextRoots in Gradle EAR plugin

**URL:** <https://discuss.gradle.org/t/unable-to-add-same-webmodule-with-different-contextroots-in-gradle-ear-plugin/663>\
**Category:** Old Forum Archive\
**Created:** [May 31, 2013, 6:12am UTC](https://discuss.gradle.org/t/unable-to-add-same-webmodule-with-different-contextroots-in-gradle-ear-plugin/663 "2013-05-31T06:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrey\_Adamovich](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/andrey_adamovich/32/224_2.png) [@Andrey\_Adamovich](https://discuss.gradle.org/u/Andrey_Adamovich)\
**Post date:** [May 31, 2013, 6:12am UTC](https://discuss.gradle.org/t/unable-to-add-same-webmodule-with-different-contextroots-in-gradle-ear-plugin/663/1 "2013-05-31T06:12:00Z")

</div>

The following configuration produces only single web module in the descriptor, but it should have 2:

ear {

libDirName ‘APP-INF/lib’

deploymentDescriptor {

version = “1.4”

displayName = ‘AuthenticationProxy’

webModule(‘authentication-proxy-web-1.0-SNAPSHOT.war’, ‘B2B’) // old endpoint

webModule(‘authentication-proxy-web-1.0-SNAPSHOT.war’, ‘AuthenticationProxy’)

}

}

This is the result:

```gradle
<?xml version="1.0"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4">
  <display-name>AuthenticationProxy</display-name>
  <module>
    <web>
      <web-uri>authentication-proxy-web-1.0-SNAPSHOT.war</web-uri>
      <context-root>B2B</context-root>
    </web>
  </module>
</application>

```

This is how it should be:

```gradle
<?xml version="1.0"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4">
  <display-name>AuthenticationProxy</display-name>
  <module>
    <web>
      <web-uri>authentication-proxy-web-1.0-SNAPSHOT.war</web-uri>
      <context-root>B2B</context-root>
    </web>
  </module>
  <module>
    <web>
      <web-uri>authentication-proxy-web-1.0-SNAPSHOT.war</web-uri>
      <context-root>AuthenticationProxy</context-root>
    </web>
  </module>
</application>

```

Of course, it easy to override by providing custom descriptor, but still it seems as a bug to me.
