Customizing The Context Root

The sample below shows how to customize the context root of an artifact to be placed in the EAR file:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.4.2</version>
        <configuration>
           [...]
           <modules>
             <webModule>
               <groupId>artifactGroupId</groupId>
               <artifactId>artifactId</artifactId>
               <contextRoot>/custom-context-root</contextRoot>
             </webModule>
          </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>