Java 无法解析proguard maven插件以混淆spring引导应用程序
我试图使用Proguard混淆spring引导应用程序,但在解决其依赖关系时失败 由于此错误,我无法构建应用程序,因为禁止访问(状态代码403)导致无法下载其中一个文件:Java 无法解析proguard maven插件以混淆spring引导应用程序,java,spring-boot,maven,proguard-maven-plugin,Java,Spring Boot,Maven,Proguard Maven Plugin,我试图使用Proguard混淆spring引导应用程序,但在解决其依赖关系时失败 由于此错误,我无法构建应用程序,因为禁止访问(状态代码403)导致无法下载其中一个文件: [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] -------------------------------------------------------
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- proguard-maven-plugin:2.3.1:proguard (default) @ ITIDAGGUtilityService ---
[INFO] Downloading from : https://dl.bintray.com/guardsquare/proguard/com/guardsquare/proguard-base/7.0.0/proguard-base-7.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.052 s
[INFO] Finished at: 2021-05-06T23:59:17+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.wvengen:proguard-maven-plugin:2.3.1:proguard (default) on project ITIDAGGUtilityService: Execution default of goal com.github.wvengen:proguard-maven-plugin:2.3.1:proguard failed: Plugin com.github.wvengen:proguard-maven-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to collect dependencies at com.github.wvengen:proguard-maven-plugin:jar:2.3.1 -> com.guardsquare:proguard-base:jar:7.0.0: Failed to read artifact descriptor for com.guardsquare:proguard-base:jar:7.0.0: Could not transfer artifact com.guardsquare:proguard-base:pom:7.0.0 from/to bintray-guardsquare-proguard (https://dl.bintray.com/guardsquare/proguard): Access denied to https://dl.bintray.com/guardsquare/proguard/com/guardsquare/proguard-base/7.0.0/proguard-base-7.0.0.pom. Error code 403, Forbidden -> [Help 1
我在pom.xml中添加了以下内容
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>5.3.3</proguardVersion>
<injar>${project.build.finalName}.jar</injar>
<outjar>${project.build.finalName}.jar</outjar>
<obfuscate>true</obfuscate>
<options>
<option>-dontshrink</option>
<option>-dontoptimize</option>
<!-- This option will replace all strings in reflections method invocations
with new class names. For example, invokes Class.forName('className') -->
<option>-adaptclassstrings</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,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod</option>
<option>-keepclassmembers public class * {void set*(***);***
get*();}</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 package. -->
<!--<option>-keep class !com.jincloud.** { *; }</option> -->
<option>-keep
@org.springframework.boot.autoconfigure.SpringBootApplication
class * {*;}</option>
<option>-keep class com.nagisa.zz.** { *; }</option>
<!-- This option will save all original class files (without obfuscate)
in service package -->
<!-- This option will save all original interfaces files (without obfuscate)
in all packages. -->
<option>-keep interface * extends * { *; }</option>
<!-- This option will save all original defined annotations in all
class in all packages. -->
<option>-keepclassmembers class * {
@org.springframework.beans.factory.annotation.Autowired *;
@org.springframework.beans.factory.annotation.Value *;
}
</option>
</options>
<libs>
<!-- Include main JAVA library required. -->
<lib>${java.home}/lib/rt.jar</lib>
</libs>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.3.3</version>
</dependency>
</dependencies>
com.github.wvengen
proguard maven插件
包裹
前卫
5.3.3
${project.build.finalName}.jar
${project.build.finalName}.jar
真的
-dontshrink
-dontoptimize
-自适应类字符串
-记述
异常、内部类、签名、弃用、源文件、LineNumberTable、LocalVariable*表、*注释*、合成、封闭方法
-keepclassmembers公共类*{void set*(***)***
得到*();}
-keepnames接口**
-基帕参数
-保持
@org.springframework.boot.autoconfigure.springboot应用程序
类*{*;}
-保持类com.nagisa.zz.*{*;}
-保持接口*扩展*{*;}
-keepclassmembers类*{
@org.springframework.beans.factory.annotation.Autowired*;
@org.springframework.beans.factory.annotation.Value*;
}
${java.home}/lib/rt.jar
net.sf.proguard
前卫基地
5.3.3
有没有人教过如何使用spring boot应用程序