混淆配置,所有的包增加classifier为xj,只对biz包混淆,混淆后classifier为obf,profile配置写好,混淆打包时勾选biz-obf+default打包,不混淆时只勾选default
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-base-core</artifactId>
|
||||
<classifier>xj</classifier>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -9,14 +9,17 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>health-im-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.renkang</groupId>
|
||||
<artifactId>health-im-api</artifactId>
|
||||
<classifier>xj</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-system-cloud-api</artifactId>
|
||||
<classifier>xj</classifier>
|
||||
</dependency>
|
||||
<!--腾讯云即时对话pom-->
|
||||
<dependency>
|
||||
@@ -35,6 +38,7 @@
|
||||
<dependency>
|
||||
<groupId>com.renkang</groupId>
|
||||
<artifactId>health-consultation-api</artifactId>
|
||||
<classifier>xj</classifier>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
@@ -54,4 +58,21 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>biz-obf</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.github.wvengen</groupId>
|
||||
<artifactId>proguard-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
-keepattributes *Annotation*, Signature, InnerClasses, EnclosingMethod, Exceptions
|
||||
-keep @org.springframework.stereotype.Service class *
|
||||
-keep @org.springframework.web.bind.annotation.RestController class *
|
||||
-keep @org.springframework.context.annotation.Configuration class *
|
||||
-keep @org.springframework.stereotype.Component class *
|
||||
-keepclassmembers enum * { # 保留枚举结构
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
-keepclassmembers class * implements java.io.Serializable { # 保留序列化类
|
||||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||||
private void writeObject(java.io.ObjectOutputStream);
|
||||
private void readObject(java.io.ObjectInputStream);
|
||||
}
|
||||
-keepclassmembers class * {
|
||||
@org.springframework.web.bind.annotation.*Mapping *;
|
||||
}
|
||||
-keepclassmembers class * {
|
||||
private static synthetic java.lang.Object $deserializeLambda$(java.lang.invoke.SerializedLambda);
|
||||
}
|
||||
-keep class lombok.** { *; }
|
||||
-keepclassmembers class * {
|
||||
@lombok.Getter *;
|
||||
@lombok.Setter *;
|
||||
}
|
||||
# MyBatis 专用保留规则
|
||||
-keep interface com.renkang.**.mapper.** { *; }
|
||||
-keepclassmembers class com.renkang.**.entity.** { *; }
|
||||
|
||||
|
||||
# 关闭优化和压缩(避免框架兼容性问题)
|
||||
-dontshrink # 不删除未使用代码
|
||||
-dontoptimize # 不优化字节码[5,6](@ref)
|
||||
-keepdirectories
|
||||
-dontusemixedcaseclassnames
|
||||
-adaptclassstrings
|
||||
# 混淆选项
|
||||
-useuniqueclassmembernames # 成员名称唯一化
|
||||
-ignorewarnings
|
||||
@@ -9,6 +9,11 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>health-im-start</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.install.skip>true</maven.install.skip>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!--微服务启动 starter-->
|
||||
<dependency>
|
||||
@@ -20,6 +25,7 @@
|
||||
<dependency>
|
||||
<groupId>com.renkang</groupId>
|
||||
<artifactId>health-im-biz</artifactId>
|
||||
<classifier>${biz-classifier}</classifier>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
<version>2.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.install.skip>true</maven.install.skip>
|
||||
</properties>
|
||||
|
||||
<!--项目子模块-->
|
||||
<modules>
|
||||
<module>health-im-api</module>
|
||||
|
||||
Reference in New Issue
Block a user