Maven Pofile excludes a jar when making a war package
Reference: http://stackoverflow.com/questions/13819558/maven-profile-removing-dependency
Conversely, add the jar to dependencies when activating a profile
For example: when continuous integration (profile ci), you need to use a certain Jar, but when releasing production (profile prod), you need to exclude the jar
<profiles> <profile> <id>ci</id> <activation> <activeByDefault>true</activeByDefault> </activation> <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> </dependencies> </profile> <profile> <id>prod</id> <dependencies> </dependencies> </profile> </profiles>