[
https://issues.apache.org/jira/browse/MWAR-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17367271#comment-17367271
]
Sebastien Dubois commented on MWAR-442:
---------------------------------------
I've taken a bit of time to explore the code, searching for explanations.
I feel like the problem lies within one of the dependencies of this project:
plexus-archiver ([http://codehaus-plexus.github.io/),] which is called here to
extract the archive:
*
[https://github.com/apache/maven-war-plugin/blob/a77ff81d370f13b5327611d70b820e6632c3ccab/src/main/java/org/apache/maven/plugins/war/packaging/OverlayPackagingTask.java#L122]
*
[https://github.com/apache/maven-war-plugin/blob/a77ff81d370f13b5327611d70b820e6632c3ccab/src/main/java/org/apache/maven/plugins/war/packaging/AbstractWarPackagingTask.java#L305]
And ultimately calls this method:
[https://github.com/sonatype/plexus-archiver/blob/master/src/main/java/org/codehaus/plexus/archiver/zip/AbstractZipUnArchiver.java#L135]
Apparently, maven-war-plugin depends on version 4.2.2 of plexus-archiver, while
version 4.2.5 is available:
* [https://github.com/codehaus-plexus/plexus-archiver/releases]
* [https://search.maven.org/artifact/org.codehaus.plexus/plexus-archiver]
Unfortunately, I haven't seen any ticket about this kind of issue over there,
so I'll create one, in the hope that my reproduction is not due to an invalid
configuration...
> WAR overlay not including the dependent WAR contents
> ----------------------------------------------------
>
> Key: MWAR-442
> URL: https://issues.apache.org/jira/browse/MWAR-442
> Project: Maven WAR Plugin
> Issue Type: Bug
> Components: overlay
> Affects Versions: 3.3.1
> Reporter: Sebastien Dubois
> Priority: Major
> Attachments: controller-carelios-build.txt
>
>
> I am currently trying to create a WAR overlay in my project, without success
> so far.
> The project is a multi-module project, in which two different modules for
> which WAR files need to be created:
> * "controller" module: uses the maven-war-plugin to create the "main" WAR
> file. This works fine, and the generated WAR file is ~60MB
> * "controller-carelios" module: uses the maven-war-plugin's overlay feature
> to create a new WAR file, which should contain the contents of the controller
> module's WAR, and add a few files on top
> As noted above, the "main" war file created for the "controller" module seems
> fine. It gets build, and added to the local maven repository.
> The problem appears when the war of the second module, "controller-carelios"
> is built with the overlay. The problem is that the generated war file ONLY
> contains the contents of the "controller-carelios" module.
> While investigating this issue, I noticed that no files are extracted from
> the controller module main war file. Although, the maven-war-plugin does seem
> to extract the file (and I see no errors in the debug log, it just states
> "expand complete")
> Here's the configuration of the "controller" module:
>
> {code:java}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <version>${maven-war-plugin.version}</version>
> <configuration>
> <failOnMissingWebXml>false</failOnMissingWebXml>
> <warSourceDirectory>target/www/</warSourceDirectory>
> <webResources>
> <resource>
> <directory>src/main/webapp</directory>
> <includes>
> <include>WEB-INF/**</include>
> </includes>
> </resource>
> </webResources>
> </configuration>
> {code}
> And here is the configuration for the "controller-carelios" module. I've
> tried different approaches to no avail..
>
> {code:java}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <configuration>
> <failOnMissingWebXml>false</failOnMissingWebXml>
> <overlays>
> <!-- Add the files of Carelios first -->
> <overlay></overlay>
> <!-- Then add the rest -->
> <overlay>
> <groupId>com.agilos.dataextraction</groupId>
> <artifactId>agilos-data-extractions-controller</artifactId>
> <type>war</type>
> </overlay>
> </overlays>
> </configuration>
> </plugin>
> {code}
> Does this issue ring any bell? Any idea what I could be doing wrong?
> The behavior seems to be the same in our CI environment.
> That project uses:
> * Java 8 (1.8.0_292)
> * Maven 3.8.1
> * maven-war-plugin 3.3.1
--
This message was sent by Atlassian Jira
(v8.3.4#803005)