Springboot 项目 maven 打包不包含第三方jar包
参考文章:https://blog.csdn.net/gaozhiqiang111/article/details/88026057
Maven 打包的时候包含第三方jar包,所以打出来的jar文件会很大,有时候我们希望在打包的过程中不包含第三方的jar文件。
只需在pom文件中加入下面的代码即可
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>***.***.Application</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork> <!-- hot deploy -->
<includes> <!-- exclude third part jar files -->
<include>
<groupId>nothing</groupId>
<artifactId>nothing</artifactId>
</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
还没有评论,来说两句吧...