[
https://jira.codehaus.org/browse/MWAR-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alan Czajkowski updated MWAR-318:
---------------------------------
Description:
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:
{code}
<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>
{code}
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/war2/pom.xml) the
overlay does work, see debug output below:
building from the _*parent*_, the packaging of war2 fails, running [mvn clean
install] from root/:
{code}
[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
{code}
building from the _*child*_, the packaging of war2 is successful, running [mvn
clean install] from root/war2/:
{code}
[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
{code}
notice how when you build from the _*parent*_, for some reason it thinks the
overlay is a JAR instead of a WAR:
{code}
[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
{code}
but when you build from the child it works properly
was:
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:
{code}
<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>
{code}
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/war2/pom.xml) the
overlay does work, see debug output below:
building from the *parent*, the packaging of war2 fails, running [mvn clean
install] from root/:
{code}
[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
{code}
building from the *child*, the packaging of war2 is successful, running [mvn
clean install] from root/war2/:
{code}
[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
{code}
notice how when you build from the _*parent*_, for some reason it thinks the
overlay is a JAR instead of a WAR:
{code}
[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
{code}
but when you build from the child it works properly
> 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:
> {code}
> <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>
> {code}
> 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/war2/pom.xml) the overlay does work, see debug output below:
> building from the _*parent*_, the packaging of war2 fails, running [mvn clean
> install] from root/:
> {code}
> [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
> {code}
> building from the _*child*_, the packaging of war2 is successful, running
> [mvn clean install] from root/war2/:
> {code}
> [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
> {code}
> notice how when you build from the _*parent*_, for some reason it thinks the
> overlay is a JAR instead of a WAR:
> {code}
> [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
> {code}
> but when you build from the child it works properly
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)