程序员的资源宝库

网站首页 > gitee 正文

SpringBoot Jar 包太大 瘦身 【初试】

sanyeah 2024-04-12 17:41:40 gitee 4 ℃ 0 评论

SpringBoot Jar 包太大 瘦身,建议使用时,参考: SpringBoot Jar 包太大 瘦身 【终极版】

 

 29M,

 

 

排除少量JAR包方式

打包,排除指定jar 包

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <layout>ZIP</layout>
                    <excludes>
                        <exclude>
                            <groupId>com.alibaba</groupId>
                            <artifactId>fastjson</artifactId>
                        </exclude>
                        <exclude>
                            <groupId>cn.hutool</groupId>
                            <artifactId>hutool-all</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

 

重新打包后发现,依赖jar没有包括在 nacos-im-server.jar 中【用 Compare 比较工具时,可能还会看到,这时候要右击刷新一下】

 

 运行

java -Dloader.path=D:\OpenSource\Netty\VipIM\lib -jar ./nacos-im-server-1.0.jar

 

 

 

 

 

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表