我有一个由maven构建的EAR文件,目前我有一个commons项目,我想把它放在EAR \ lib中,所以我用了'bundleDir'标签的maven-ear-plugin,它工作正常现在我的commons.jar出现在lib文件夹和EAR根目录中。我如何告诉它只把它放在lib文件夹中?如何防止maven复制EAR文件中的jar文件?
我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>
我只想指出,这个问题的标题看起来很奇怪,当脱离上下文。 :) – 2012-03-04 15:44:51
我知道标题有点奇怪,但我有一个非常漫长的一天:) – Tomer 2012-03-04 16:17:09
你可以发布你的pom.xml文件中的commons.jar的依赖关系定义,谢谢。 – hovanessyan 2012-03-04 16:59:56