2015-02-05 154 views
0

我想排除標有紅線的文件夾。我該怎麼做? enter image description here如何從war maven文件夾中排除文件夾

這裏是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>com.test</groupId> 
<artifactId>Test</artifactId> 
<packaging>war</packaging> 
<version>1.0</version> 
<url>http://maven.apache.org</url> 
    <properties> 
     <spring-version>4.1.0.RELEASE</spring-version> 
     <spring-security-version>3.2.3.RELEASE</spring-security-version> 
     <hibernate-version>4.3.4.Final</hibernate-version> 
    </properties> 

    <dependencies> 
     <!-- a lot of dependecies --> 
    </dependencies> 
<build> 
    <finalName>Test</finalName> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.3.2</version> 
      <configuration> 
       <source>1.5</source> 
       <target>1.5</target> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 
</project> 

我應該做任何Maven的編譯器插件配置?

回答

1

這應該給你答案,你需要:http://maven.apache.org/plugins/maven-war-plugin/examples/including-excluding-files-from-war.html

下面是一個例子,我們從WEB-INF/lib目錄中排除所有JAR文件:

<project> 
    ... 
    <build> 
    <plugins> 
     <plugin> 
     <artifactId>maven-war-plugin</artifactId> 
     <version>2.6</version> 
     <configuration> 
      <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
    ... 
</project> 

這不與maven編譯器插件有什麼關係,但是maven war plugin

相關問題