我一直在使用 maven-ear-plugin 创建耳包并使用自定义 contextRoot 生成 application.xml(一切正常)。现在我想创建 2 个耳包并将它们部署在不同的上下文路径下,所以我定义了具有 2 个执行的插件。但是由于某种原因,maven-ear-plugin 忽略了 contextRoot 属性,并且在生成的 application.xml 中,它在两个耳朵中都使用 artifactId 而不是 contextRoot(因此它们具有相同的上下文根“app-ui”)。这是我的 maven-ear-plugin 定义:
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>app1</id>
<phase>package</phase>
<goals>
<goal>ear</goal>
</goals>
<configuration>
<finalName>app1</finalName>
<modules>
<webModule>
<groupId>com.x.y</groupId>
<artifactId>app-ui</artifactId>
<contextRoot>/app1-ui</contextRoot>
</webModule>
</modules>
</configuration>
</execution>
<execution>
<id>app2</id>
<phase>package</phase>
<goals>
<goal>ear</goal>
</goals>
<configuration>
<finalName>app2</finalName>
<modules>
<webModule>
<groupId>com.x.y</groupId>
<artifactId>app-ui</artifactId>
<contextRoot>/app2-ui</contextRoot>
</webModule>
</modules>
</configuration>
</execution>
请问有什么建议吗?