I am building an EAR that contains unpacked WARs. 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. I thought of using two different executions of maven-ear-plugin
, but I always get two completely the same EARs. 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. This is the relevant part of my pom.xml
(inside maven-ear-plugin
plugin tag).
<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.
(team work, see comments):
Setting a different workDirectory
helps. (see Maven EAR plug-in docs)