java - 无法解析 proguard maven 插件以混淆 Spring Boot 应用程序
问题描述
我正在尝试使用 Proguard 混淆 Spring Boot 应用程序,但在解析其依赖项时失败。
由于此错误,我无法构建应用程序,因为由于禁止访问(状态代码 403)而无法下载其中一个文件:
[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>
有没有人有教程如何混淆一个弹簧启动应用程序?
解决方案
推荐阅读
- mysql - 订单后TRIGGER和选择查询产品列表的问题
- ios - swiftui 2中的背景视频
- google-apps-script - 将数据放在下一个空白行中,选择错误的列
- ios - 选择器控件绑定到索引而不是标记
- r - R - 当时间列中已经包含当前系统日期时合并数据和时间
- r - 如何正确使用 tryCatch() 并忽略此 rvest 函数中的 404 错误?
- c++ - 排名时指针类型的恒等转换是否视为资格转换
- python - Python 彩票程序 - 如何比较随机列表?
- visual-studio-code - 我可以从 vscode task.json 的删除双引号中保存吗?
- javascript - 任何人都可以协助处理与 discord.js 相关的似乎无法正常工作的代码吗?