下面的示例显示了如何自定义要放置在 EAR 文件中的工件的上下文根:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>3.0.0</version>
<configuration>
[...]
<modules>
<webModule>
<groupId>artifactGroupId</groupId>
<artifactId>artifactId</artifactId>
<contextRoot>/custom-context-root</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>