Maven: update context root in EAR


When using Maven3 to build your enterprise application containing an war file, the war file’s context root is set as


If you want to overwrite this root context, you can do this in the EAR’s pom.xml.

Plugin configuration


Usually you should find the values for <groupId> and <artifactId> already in the same pom in the dependency lists, as the WAR should be a dependency of the EAR.  As you do not specify the version of the WAR in the webmodule configuration it updates on its own whenever you change the dependency version of the WAR.

Leave a Reply