ProGuard + Maven与Java 7 [英] ProGuard + Maven with Java 7
问题描述
我正在尝试使ProGuard成为我们Maven构建过程的一部分.问题在于,官方的Maven插件正在使用不支持Java 7的ProGuard 4.3.是否有任何简单的方法可以使该插件改为使用Proguard 4.8?
I'm trying to make ProGuard part of our Maven build process. The problem is that the official Maven plugin is using ProGuard 4.3, which doesn't support Java 7. Is there any easy way to make the plugin use Proguard 4.8 instead?
我尝试为插件指定依赖关系,但是ProGuard似乎为Maven模块提供了新的结构(proguard-base,proguard-parent等),因此插件不能使用任何大于4.4的版本.这是我当前的pom外观:
I've tried specifying the dependency for the plugin but ProGuard seems to have a new structure for Maven-modules (proguard-base, proguard-parent etc) so the plugin can't use any version >4.4. Here's how my current pom looks:
<plugin>
<groupId>com.pyx4me</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>4.8</proguardVersion>
<obfuscate>true</obfuscate>
<options>
<option>-allowaccessmodification</option>
<option>-keep public class com.degoo.ui.ClientBackendStarter { public *; public static *; }</option>
</options>
<injar>${project.build.finalName}.jar</injar>
<outjar>${project.build.finalName}-small.jar</outjar>
<outputDirectory>${project.build.directory}</outputDirectory>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/jsse.jar</lib>
</libs>
<addMavenDescriptor>false</addMavenDescriptor>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard</artifactId>
<version>4.8</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
有什么建议吗?
推荐答案
I found a solution here: https://groups.google.com/forum/?fromgroups#!topic/pyx4me-users/NUZi1oySvQE. Basically I had to download and install ProGuard to my local repo.
这篇关于ProGuard + Maven与Java 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!