2020-07-15 Spring boot打jar包独立出依赖库的方法 1234567891011121314151617181920212223242526272829303132<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <layout>ZIP</layout> <includes> <include><!-- 只包含自己 --> <groupId>cn.com.mine.groupid</groupId> <artifactId>mine-artifact</artifactId> </include> </includes> </configuration></plugin><!-- 拷贝出依赖库 --><plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory> ${project.build.directory}/lib </outputDirectory> </configuration> </execution> </executions></plugin> 启动时增加加载依赖包的路径1java -Dloader.path="lib/" -jar xxx.jar 前一篇 Spring boot 发起http请求的简单用法 后一篇 Spring boot Websocket & SseEmitter