[
https://issues.apache.org/jira/browse/MWAR-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17524904#comment-17524904
]
Tuzhilkin Mikhail commented on MWAR-440:
----------------------------------------
[~sjaranowski], I checked. Indeed, specifying different {{webappDirectory}}
solves this problem.
{code:xml}
<executions>
<execution>
<id>1</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
<configuration>
<skip>false</skip>
<webXml>src/main/webapp/web1.xml</webXml>
<warName>web1</warName>
<webappDirectory>${project.build.directory}/web1</webappDirectory>
</configuration>
</execution>
<execution>
<id>2</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
<configuration>
<skip>false</skip>
<webXml>src/main/webapp/web2.xml</webXml>
<warName>web2</warName>
<webappDirectory>${project.build.directory}/web2</webappDirectory>
</configuration>
</execution>
</executions>
{code}
Thank you very much
> When it is necessary to build more than one WAR archive at the same time, it
> fails to set different web.xml
> -----------------------------------------------------------------------------------------------------------
>
> Key: MWAR-440
> URL: https://issues.apache.org/jira/browse/MWAR-440
> Project: Maven WAR Plugin
> Issue Type: Bug
> Affects Versions: 3.0.0, 3.2.0, 3.2.2
> Reporter: Tuzhilkin Mikhail
> Priority: Major
>
> In an assembly, I need to create 2 WAR archives with different web.xml files
> at a time.
> For this I use the following plugin setting:
> {code:xml}
> <plugin>
> <artifactId>maven-war-plugin</artifactId>
> <version>3.2.2</version>
> <configuration>
> <packagingExcludes>web?.xml</packagingExcludes>
> <skip>true</skip>
> </configuration>
> <executions>
> <execution>
> <id>1</id>
> <phase>package</phase>
> <goals>
> <goal>war</goal>
> </goals>
> <configuration>
> <skip>false</skip>
> <webXml>src/main/webapp/web1.xml</webXml>
> <warName>web1</warName>
> </configuration>
> </execution>
> <execution>
> <id>2</id>
> <phase>package</phase>
> <goals>
> <goal>war</goal>
> </goals>
> <configuration>
> <skip>false</skip>
> <webXml>src/main/webapp/web2.xml</webXml>
> <warName>web2</warName>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {code}
> {code}
> Project structure:
> src/main/webapp/web1.xml
> src/main/webapp/web2.xml
> pom.xml
> {code}
> {code:xml}
> <!-- web1.xml -->
> <web-app>
> <!-- Content web1.xml-->
> </web-app>
> {code}
> {code:xml}
> <!-- web2.xml -->
> <web-app>
> <!-- Content web2.xml-->
> </web-app>
> {code}
> But the first of the specified files gets into both archives, despite the
> different paths <webXml>.
> {code}
> $ unzip -p web1.war WEB-INF/web.xml
> <web-app>
> <!-- Content web1.xml-->
> </web-app>
> $ unzip -p web2.war WEB-INF/web.xml
> <web-app>
> <!-- Content web1.xml-->
> </web-app>
> {code}
> Example project: [https://github.com/tuzhms/mwar-bug-example]
--
This message was sent by Atlassian Jira
(v8.20.7#820007)