Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Maven assembly plugin descriptor to bundle all WAR dependencies into a zip file, including local resource files. This is useful when you don't use EARs, but still want to package several web applications into one big archive, plus any additional stuff (e.g. configuration files) needed for deployment.
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<!-- A Maven assembly plugin descriptor to bundle all WAR dependencies into a zip file, including local
resource files. This is useful when you don't use EARs, but still want to package several web applications
into one big archive, plus any additional stuff (e.g. configuration files) needed for deployment. -->
<id>dist</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet> <!-- include all WAR dependencies, with artifactName.war format (no versions) -->
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
<unpack>false</unpack>
<scope>runtime</scope>
<outputDirectory>applications/</outputDirectory>
<includes>
<include>*:*:war:*</include>
</includes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet> <!-- include resource files in this project -->
<filtered>true</filtered>
<outputDirectory>.</outputDirectory>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.