我是新手我不知道如何使用proguard优化代码我正在挖掘谷歌我用我的maven java桌面应用程序实现它。但现在它显示我超出例外..我不知道如何解决它...需要帮助。 POM.XML
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.6</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>5.0</proguardVersion>
<obfuscate>true</obfuscate>
<injar>${project.build.finalName}.jar</injar>
<outjar>${project.build.finalName}-small.jar</outjar>
<outputDirectory>${project.build.directory}</outputDirectory>
<proguardInclude>${basedir}/config.pro</proguardInclude>
<proguardInclude>${basedir}/proguard.conf</proguardInclude>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/jsse.jar</lib>
</libs>
<options>
<option>-keepclasseswithmembers</option>
<option>-dontwarn</option>
</options>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
答案 0 :(得分:1)
-keepclasseswithmembers期待更多的args,这就是你收到错误的原因。 这是正确的语法 -
-keepclasseswithmembers class_specification
您可以找到用法here