1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-01 22:53:29 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

jar包打包时不将依赖打入其中,减少jar包大小

This commit is contained in:
2022-04-09 18:27:12 +08:00
parent b4d7f858a3
commit 8cfdf78eaf
3 changed files with 30 additions and 0 deletions

View File

@@ -326,6 +326,32 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.12</version>
<!--
以下是将 jar 包中 BOOT-INF/lib 中的依赖 jar 包排除
refer: https://mp.weixin.qq.com/s/xPRNlIT9Ac4STKzMRyUhqQ
[Tips] 如果希望将完整依赖打包到 jar 包中,请注释掉下面
<configuration> 和 <executions> 两个标签
-->
<!-- start -->
<configuration>
<layout>ZIP</layout>
<includes>
<include>
<groupId>nothing</groupId>
<artifactId>nothing</artifactId>
</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<!-- end -->
</plugin>
<!-- 拉姆达表达式需要支持 Java 8 语法 -->

View File

@@ -137,6 +137,9 @@ public class QCloudCosUtils {
return url.toString();
}
/**
* 销毁 CosClient 对象方法
*/
public static void destoryInstance() {
if (_cosClient != null) {
// 确认本进程不再使用 cosClient 实例之后,关闭之

View File

@@ -0,0 +1 @@
java -Dloader.path=D:\temp\lib -jar target/bookshelfplus-1.0-SNAPSHOT.jar