Alan Czajkowski created MWAR-318: ------------------------------------ Summary: WAR overlay does not work when building child modules from the parent Key: MWAR-318 URL: https://jira.codehaus.org/browse/MWAR-318 Project: Maven WAR Plugin Issue Type: Bug Components: overlay Affects Versions: 2.4 Environment: OS X Reporter: Alan Czajkowski
project layout: root/pom.xml (parent POM) root/war1/pom.xml root/war2/pom.xml war2 artifact will overlay on top of war-1 artifact war2 plugin definition: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <attachClasses>true</attachClasses> <dependentWarIncludes>**</dependentWarIncludes> <overlays> <overlay> <id>war1</id> <groupId>com.example</groupId> <artifactId>war1</artifactId> <type>war</type> </overlay> <overlay> <!-- empty groupId/artifactId represents the current build --> </overlay> </overlays> </configuration> </plugin> running: mvn clean install when building the entire project from the parent (root/pom.xml) the overlay does not work, when building just from the child (root/war-2/pom.xml) the overlay does work, see debug output below: building from the *parent*, running [mvn clean install] from root/: [DEBUG] OverlayPackagingTask performPackaging overlay.getTargetPath() null [INFO] Processing overlay [ id war1] [DEBUG] Expanding: /Users/bingo/dev/example/root/war1/target/war1-1.0-SNAPSHOT.jar into /Users/bingo/dev/example/root/war2/target/war/work/com.example/war1 [DEBUG] expand complete building from the *child*, running [mvn clean install] from root/war2/: [DEBUG] OverlayPackagingTask performPackaging overlay.getTargetPath() null [INFO] Processing overlay [ id war1] [DEBUG] Expanding: /Users/bingo/.m2/repository/com/example/war1/1.0-SNAPSHOT/war1-1.0-SNAPSHOT.war into /Users/bingo/dev/example/root/war2/target/war/work/com.example/war1 [DEBUG] expand complete notice how when you build from the parent, for some reason it thinks the overlay is a JAR instead of a WAR: [DEBUG] Expanding: /Users/bingo/dev/example/root/war1/target/war1-1.0-SNAPSHOT.jar into /Users/bingo/dev/example/root/war2/target/war/work/com.example/war1 but when you build from the child it works properly -- This message was sent by Atlassian JIRA (v6.1.6#6162)