问题描述
我正在尝试使用 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 (将#修改为@)