实现自动复制lib下jar包到指定目录,打包项目时只打包自己项目的代码。 pom文件配置如下: <build> <plugins> <!--打包插件,只保留了项目运行的jar包--> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <layout>ZIP</layout> <includes> <include> <groupId>nothing</groupId> <artifactId>nothing</artifactId> </include> </includes> </configuration> <executions> <execution> <goals> <goal> repackage </goal> </goals> </execution> </executions> </plugin> <!--打出项目依赖的第三方包,放在lib下面--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>E:/FutongCode/wangrz/lib</outputDirectory> <excludeTransitive>false</excludeTransitive> <stripVersion>false</stripVersion> <includeScope>runtime</includeScope> </configuration> </execution> </executions> </plugin> </plugins> </build>
Springboot 打jar包分离lib
最新推荐文章于 2021-01-03 11:38:27 发布