Maven打包排除不需要的文件。

pom.xml

<!-- package打包排除掉一些配置文件 -->
            <plugin>    
                <groupId>org.apache.maven.plugins</groupId>    
                <artifactId>maven-war-plugin</artifactId>    
                <version>2.0.2</version>    
                <configuration>    
                     <warSourceExcludes>src/main/resources/**</warSourceExcludes>    
                </configuration>    
            </plugin>    
            
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.1.1</version>
    <configuration>
      <webResources>
        <resource>
          <directory>src/main/webapp</directory>
          <excludes>
            <exclude>**/*.jpg</exclude>
          </excludes>
        </resource>
      </webResources>
    </configuration>
  </plugin>


<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <configuration> <excludes> <exclude>src/main/resources/*.sql</exclude> </excludes> </configuration> </plugin>

原文地址:https://www.cnblogs.com/cocoat/p/4986287.html