In the project release, you may encounter this situation, I hope that the project source code to maintain the same premise, you want to be able to target different operating environment to obtain the corresponding running package. (e.g. War pack)
Basic Configuration : (including the configuration of the jar that does not want to enter the war package )
<build><filters><!--filter file, usually a property file (in the form of a name-value pair)--><filter>src/main/webapp/meta-inf/ auto-config.properties</filter><!--<filter>${user.home}/antx.properties</filter>--> </filters><finalName>communitytag</finalName><plugins><plugin><groupId> Org.apache.maven.plugins</groupid><artifactid>maven-war-plugin</artifactid><version> 2.1-alpha-1</version><configuration><!--to filter out the jar that does not want to be punched in. War package, note: This place, the original path should be web-inf/lib/ Anaalyzer-2.0.4.jar, but after many experiments, can not do so, as to what happened, do not understand. Verified by the multi-party no results for the moment, although it seems very ugly, but always solve the problem it--><warsourceexcludes>*/lib/analyzer-2.0.4.jar</warsourceexcludes ><webResources><resource>< the directory of the!--meta-profile, relative to the path of the Pom.xml file--><directory>src/main/webapp/ web-inf</directory><!--whether to filter the file, that is, whether to start Auto-config function--><filtering>true</filtering><! --Target path--><targetpath>web-inf</targetpath></resource></webresouRces></configuration></plugin></plugins></build>
Reference: http://nileader.blog.51cto.com/1381108/449956
Maven-war-plugin Official website: http://maven.apache.org/plugins/maven-war-plugin/
About Maven's plugin Maven-war-plugin