[英]How to build two EARs using maven, one with modules packed and the other unpacked?
I am building an EAR that contains unpacked WARs. 我正在构建一个包含解压缩WAR的EAR。 But due to a bug in Arqullian Test Framework , I need to build another EAR, that will look the same, but the WARs inside will be packed.
但由于Arqullian测试框架中的一个错误 ,我需要构建另一个看起来相同的EAR,但内部的WAR将被打包。 I thought of using two different executions of
maven-ear-plugin
, but I always get two completely the same EARs. 我想过使用两种不同的
maven-ear-plugin
执行方式,但我总是得到两个完全相同的EAR。 This is because when maven copies the packed (or unpacked) WARs into build directory, it won't overwrite them with the unpacked (or packed) versions in the next execution. 这是因为当maven将打包(或解压缩)的WAR复制到构建目录中时,它不会在下次执行时使用解压缩(或打包)版本覆盖它们。 This is the relevant part of my
pom.xml
(inside maven-ear-plugin
plugin tag). 这是我的
pom.xml
的相关部分(在maven-ear-plugin
插件标签内)。
<executions>
<execution>
<id>arq</id>
<phase>package</phase>
<goals>
<goal>ear</goal>
</goals>
<configuration>
<classifier>arq</classifier>
<unpackTypes>sar</unpackTypes>
</configuration>
</execution>
<execution>
<id>main</id>
<phase>package</phase>
<goals>
<goal>ear</goal>
</goals>
<configuration>
<classifier></classifier>
<unpackTypes>war,sar</unpackTypes>
</configuration>
</execution>
</executions>
The order of the executions doesn't matter. 处决的顺序无关紧要。
I want to tell maven
to overwrite the WARs (either directories or archives), or maybe find another elegant solution to this problem. 我想告诉
maven
覆盖WAR(目录或档案),或者找到另一个优雅的解决方案来解决这个问题。
(team work, see comments): (团队合作,见评论):
Setting a different workDirectory
helps. 设置不同的
workDirectory
帮助。 ( see Maven EAR plug-in docs ) ( 参见Maven EAR插件文档 )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.