修改pom配置文件
我使用的是JDK21,所以需要高版本的ProGuard,低版本的不行
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>iptvcrm</artifactId>
<groupId>com.wisetv</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<build>
<plugins>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.6.1</version>
<executions>
<execution>
<id>proguard</id>
<!-- 在打包阶段混淆-->
<phase>package</phase>
<goals>
<!-- 只使用混淆功能-->
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>7.5.0</proguardVersion>
<!-- 原始jar包-->
<injar>${project.build.finalName}.jar</injar>
<!-- 混淆之后的jar包名 此处与原始一样 混覆盖原始jar包-->
<outjar>${project.build.finalName}-pg.jar</outjar>
<obfuscate>true</obfuscate>
<options>
<option>-dontshrink</option>
<option>-dontoptimize</option>
<!-- ##对于类成员的命名的混淆采取唯一策略-->
<option>-useuniqueclassmembernames</option>
<!-- This option will replace all strings in reflections method invocations with new class names.
For example, invokes Class.forName('className')-->
<option>-adaptclassstrings</option>
<!-- ## 混淆时不生成大小写混合的类名,默认是可以大小写混合-->
<option>-dontusemixedcaseclassnames</option>
<!-- This option will save all original annotations and etc. Otherwise all we be removed from files.-->
<option>-keepattributes
Exceptions,
InnerClasses,
Signature,
Deprecated,
SourceFile,
LineNumberTable,
*Annotation*,
EnclosingMethod
</option>
<!-- This option will save all original names in interfaces (without obfuscate).-->
<option>-keepnames interface **</option>
<!-- This option will save all original methods parameters in files defined in -keep sections,
otherwise all parameter names will be obfuscate.-->
<!-- <option>-keepparameternames</option>-->
<!-- This option will save all original class files (without obfuscate) but obfuscate all
in domain and service packages.-->
<option>-keep
class com.wisetv.useroutbound.app.UserOutBoundApplication {
public static void main(java.lang.String[]);
}