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