我需要使用Maven創建兩個帶有兩個不同web.xml
文件的WAR文件。否則,WAR文件是相同的。Maven:用不同的web.xml創建兩個war文件?
WAR文件按預期創建,但第二個文件與第一個文件具有相同的web.xml
文件。
如何強制Maven WAR插件爲第二個WAR使用第二個文件?我無法使用配置文件,因爲我需要一次創建兩個文件。
我當前的代碼:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<warSourceDirectory>${basedir}/WEB</warSourceDirectory>
<warName>main</warName>
<webXml>${basedir}/CONF/web.xml</webXml>
</configuration>
<executions>
<execution>
<id>hist-war</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
<configuration>
<warName>hist</warName>
<warSourceDirectory>${basedir}/WEB</warSourceDirectory>
<webXml>${basedir}/CONF/hist.web.xml</webXml>
</configuration>
</execution>
</executions>
</plugin>
我剛剛發現了另一個選項,它似乎在我的情況下工作(從這個[鏈接](http://maven.apache.org/plugins/maven-war-plugin/faq.html#filtering)): 'filteringDeploymentDescriptors'配置屬性。 – KirEvse