如何解决ProGuard Maven 找不到 jar
我正在尝试使用 proguard 混淆我的 jar,但它失败并显示以下消息: 无法在项目 AdvancedMLGrush 上执行目标 com.github.wvengen:proguard-maven-plugin:2.0.13:proguard (default-cli):找不到文件 D:\IdeaProjects\AdvancedMLGrushOld\target\AdvancedMLGrush.jar
它找不到 jar,因为我更改了输出目录。我怎样才能解决这个问题?提前致谢!
Maven 插件:
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.13</version>
<executions>
<execution>
<id>obfuscation-packaging</id>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
<configuration>
<proguardVersion>LATEST</proguardVersion>
<obfuscate>true</obfuscate>
<attach>true</attach>
<appendClassifier>false</appendClassifier>
<addMavendescriptor>true</addMavendescriptor>
<injar>${project.build.finalName}.jar</injar>
<injarNotExistsSkip>true</injarNotExistsSkip>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
</libs>
<options>
<option>-keepdirectories</option>
<option>-keeppackagenames org.apache.maven.plugin.my.MyMojo</option>
<option>-keepnames class * implements org.apache.maven.plugin.AbstractMojo</option>
<option>-keepclassmembers class * implements org.apache.maven.plugin.AbstractMojo {
private <![CDATA[<fields>]]>;
private <![CDATA[<methods>]]>;
}
</option>
<option>-keepparameternames</option>
<option>-renamesourcefileattribute SourceFile</option>
<option>-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
</option>
<option>-target 1.8</option>
<option>-keep public class * {
public protected *;
}
</option>
<option>-keepclassmembernames class * {
java.lang.class class$(java.lang.String);
java.lang.class class$(java.lang.String,boolean);
}
</option>
<option>-keepclasseswithmembernames,includedescriptorclasses class * {
native <![CDATA[<methods>]]>;
}
</option>
<option>-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
</option>
<option>-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readobject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
</option>
</options>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
</plugin>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。