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

相关推荐
宫_商_角_徵14 小时前
动态代理到底在做什么?
后端
小碗羊肉14 小时前
【从零开始学Java | 第三十一篇下】Stream流
java·开发语言
苍何14 小时前
我把微信 cli 开源了,群消息终于不用爬楼了!
后端
Moment14 小时前
当前端开始做 Agent 后,我才知道 LangGraph 有多重要❗❗❗
前端·后端·面试
小蜜蜂dry14 小时前
nestjs实战-登录、鉴权(一)
前端·后端·nestjs
苍何15 小时前
接入Seedance 2.0 后的 OiiOii,太让人上头了!
后端
❀͜͡傀儡师15 小时前
Spring AI Alibaba vs. AgentScope:两个阿里AI框架,如何选择?
java·人工智能·spring
aq553560015 小时前
Laravel10.x重磅升级,新特性一览
android·java·开发语言
一 乐15 小时前
酒店预订|基于springboot + vue酒店预订系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·酒店预订系统
Z.风止15 小时前
Large Model-learning(3)
人工智能·笔记·后端·深度学习