Maven打包排除某个资源或者目录

排除某个资源文件

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <excludes>
                        <exclude>core-site.xml</exclude>
                        <exclude>hdfs-site.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>

排除某个目录

<project>
  ...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <includes>
            <include>**/service/*</include>
          </includes>
        </configuration>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

 

参考:

https://www.cnblogs.com/xing901022/p/8080122.html(以上内容转自此篇文章)

https://www.cnblogs.com/zdz8207/p/java-maven-pom-resource-exclude.html

http://blog.csdn.net/sundenskyqq/article/details/49930387

http://blog.csdn.net/cyzero/article/details/8251643

posted @ 2018-03-01 17:48  EasonJim  阅读(6036)  评论(0编辑  收藏  举报