Skip to content

Instantly share code, notes, and snippets.

@klausbrunner
Created December 20, 2012 09:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klausbrunner/4344204 to your computer and use it in GitHub Desktop.
Save klausbrunner/4344204 to your computer and use it in GitHub Desktop.
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