我有一个由 maven 构建的 EAR 文件,目前我有一个公共项目,我想把它放在一个 EAR\lib 中,所以我使用了带有 'bundleDir' 标签的 maven-ear-plugin,它工作正常,只是现在我的 commons.jar 出现在 lib 文件夹和 EAR 根目录中。我如何告诉它只把它放在 lib 文件夹中?
我的pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<outputDirectory>../../outputs/java</outputDirectory>
<version>5</version>
<modules>
<jarModule>
<groupId>com.sample.common</groupId>
<artifactId>common</artifactId>
<includeInApplicationXml>
true
</includeInApplicationXml>
<bundleDir>/lib</bundleDir>
</jarModule>
...
</modules>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>ear</goal>
</goals>
</execution>
</executions>
</plugin>
这是依赖定义:
<dependency>
<groupId>com.sample.common</groupId>
<artifactId>common</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>