Skip to content

Instantly share code, notes, and snippets.

@banterCZ
Last active August 29, 2015 14:23
Show Gist options
  • Save banterCZ/76232e9c0757de16c397 to your computer and use it in GitHub Desktop.
Save banterCZ/76232e9c0757de16c397 to your computer and use it in GitHub Desktop.
How to keep war clean
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>org.hibernate</exclude>
<exclude>org.slf4j:slf4j-api:jar:*:compile</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</execution>
<execution>
<id>enforce-file-size</id>
<goals>
<goal>enforce</goal>
</goals>
<phase>package</phase>
<configuration>
<rules>
<requireFilesSize>
<!-- size in bytes -->
<maxsize>7000000</maxsize>
<files>
<file>${project.build.directory}/${project.build.finalName}.war</file>
</files>
</requireFilesSize>
</rules>
</configuration>
</execution>
</executions>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment