微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法解析 proguard maven 插件来混淆 Spring Boot 应用程序

如何解决无法解析 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>

有没有人有如何对 spring boot 应用程序进行 obufscate 的教程?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?