編譯時排除特定的檔案(War project)
Posted by Bruce Tsai
排除設定檔
<?xml version="1.0"?>
<project xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.boboo.crm</groupId>
<artifactId>boboo</artifactId>
<version>0.0.1</version>
</parent>
<artifactId>boboo-portal</artifactId>
<packaging>war</packaging>
<repositories>
...
</repositories>
<dependencies>
...
</dependencies>
<build>
<finalName>bobooo</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<resourceEncoding>UTF-8</resourceEncoding>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>production</id>
<build>
<finalName>bobooo</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<resourceEncoding>UTF-8</resourceEncoding>
<!-- 排除特定的檔案(使用regular expression) -->
<packagingExcludes>
%regex[WEB-INF/lib/AethosClient.*],
%regex[WEB-INF/lib/NonBill.*],
%regex[WEB-INF/lib/OfferEffectiveDateProxy.*],
%regex[WEB-INF/lib/RetvSIGServerProxy.*],
%regex[WEB-INF/lib/SGWEjb.*],
%regex[WEB-INF/lib/SIG2.0.*],
%regex[WEB-INF/lib/SIGServerProxy.*],
%regex[WEB-INF/lib/SigEJB.*],
%regex[WEB-INF/lib/SmsgAPI.*],
%regex[WEB-INF/lib/UnBillEJB.*],
%regex[WEB-INF/lib/embeddedFont.*],
%regex[WEB-INF/lib/fet_sig_remote.*],
%regex[WEB-INF/lib/knex.*],
%regex[WEB-INF/lib/siggw.*],
%regex[WEB-INF/lib/wli.*]
</packagingExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>