【发布时间】:2012-03-04 15:41:20
【问题描述】:
我有一个由 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>
【问题讨论】:
-
我知道标题有点奇怪,但我度过了漫长的一天 :)
-
能否从 pom.xml 文件中发布关于 commons.jar 的依赖定义,谢谢。
-
我已经用依赖更新了主要部分
标签: java maven-2 maven-plugin maven-ear-plugin