[ 
https://issues.apache.org/jira/browse/MWAR-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17524883#comment-17524883
 ] 

Slawomir Jaranowski commented on MWAR-440:
------------------------------------------

Second execution should have own space - so parameters like 
{{{}outputDirectory{}}}, {{{}webappDirectory{}}}, {{workDirectory}} should be 
changed.

I see that you only want have different one file ... but separate space can 
resolve your issue. 
Need to test which parameters should be changed, maybe one of them will be 
enough.

https://maven.apache.org/plugins/maven-war-plugin/war-mojo.html

> 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)

Reply via email to