I would like to update the answer to @Michael Wyraz and just enable skip settings if someone runs mvn clean install build at the top level of a project with several modules, and one of the submodules is a web application.
This is inside the war module:
<profiles> <profile> <id>war_explode</id> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <executions> <execution> <id>default-war</id> <phase>none</phase> </execution> <execution> <id>war-exploded</id> <phase>package</phase> <goals> <goal>exploded</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <executions> <execution> <id>default-install</id> <phase>none</phase> </execution> </executions> </plugin> </plugins> </pluginManagement> </build> </profile> </profiles>
Without installation, skip the crash assembly when trying to install war in the .m2 folder. The error message is as follows:
[INFO] --- maven-install-plugin:2.4:install (default-install) @ *** --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install) on project ***: The packaging for this project did not assign a file to the build artifact -> [Help 1]
Performing mvn clean install -P war_explode with these settings (nested in the maven profile named war_explode), it completes the build without errors.
David Mar 26 '15 at 9:47 2015-03-26 09:47
source share