I am trying to use Proguard to obfuscate my Java 8 App.
Proguard supports Java 8 since version 5.0
For some reason the program-maven-plugin ignores my configuration to use Proguard version 5.1 and uses 4.3, incompatible with Java 8.
My configuration is
<plugin>
<groupId>com.pyx4me</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>5.1</proguardVersion>
<obfuscate>true</obfuscate>
<options>
<option>-allowaccessmodification</option>
<option>-keep class mypackage.Testt</option>
</options>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/javafx-mx.jar</lib>
</libs>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
Any clue?
Tks,
Answering my own question... It happens that Proguard version 5.1 is not yet available on Maven repositories. It is necessary to manually download it and run:
mvn install:install-file -Dfile=./proguard.jar -DgroupId=net.sf.proguard -DartifactId=proguard -Dversion=5.1 -Dpackaging=jar
In addition, the correct Proguard configuration is:
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard</artifactId>
<version>5.1</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With