spring boot 增量包部署,jar包变小

##pom.xml配置

java 复制代码
<plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <layout>ZIP</layout>
                    <includes>
                        <include>
                            <groupId>non-exists</groupId>
                            <artifactId>non-exists</artifactId>
                        </include>
                    </includes>
                </configuration>
            </plugin>
            <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>
                            <!--依赖jar包的输出目录,根据自己喜好配置-->
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>

##编译目录结构

##运行时拷贝lib目录的jar包到zsjf-resources-file-1.0.jar同级目录。-Dloader.path指定lib目录

java -jar -Dloader.path=./lib zsjf-resources-file-1.0.jar

相关推荐
It's now3 分钟前
Spring Framework 7.0 原生弹性功能系统讲解
java·后端·spring
点PY3 分钟前
C++ 中 std::async 和 std::future 的并发性
java·开发语言·c++
无限大610 分钟前
Agent 入门科普:从"人工智障"到"数字打工人"的进化史
后端
一 乐32 分钟前
人事管理系统|基于Springboot+vue的企业人力资源管理系统设计与实现(源码+数据库+文档)
java·前端·javascript·数据库·vue.js·spring boot·后端
带刺的坐椅35 分钟前
Solon AI 开发学习19 - 结合 Solon Flow 实现 ReAct 效果
java·ai·chatgpt·llm·openai·solon·deepseek
SelectDB37 分钟前
浙江头部城商行:每日 700 万查询、秒级响应,Apache Doris 查算分离架构破局资源冲突
数据库·后端·apache
CoderYanger38 分钟前
Java SE——12.异常(≠错误)《干货笔记》
java·开发语言
Data_agent1 小时前
1688获得1688店铺所有商品API,python请求示例
java·开发语言·python
why1511 小时前
面经整理——算法
java·数据结构·算法
越来越无动于衷1 小时前
Java 实现 WebService(SOAP)联网调用:从原理到实战
java·开发语言