I'm working on plugin obfuscation. In general, obfuscation is working (at target I have obfuscated jar), but when I'm building product, there is no obfuscated plugin. When I add some methods to the code, method is in product. I have no idea why not obfuscated plugin is at product. I'm using maven-tycho
, p2
and jenkins as builder. Here is my maven configuration for obfuscation with maven:
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.6</version>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>5.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardVersion>5.2</proguardVersion>
<options>
<option>-keep class org.apache.** { *; }</option>
<option>-keep class org.osgi.** { *; }</option>
<option>-keep class org.eclipse.** { *; }</option>
<option>-keep class * extends
org.eclipse.ui.plugin.AbstractUIPlugin
</option>
<option>-keep class * extends org.eclipse.ui.part.ViewPart</option>
<option>-keep class * implements org.eclipse.ui.INewWizard</option>
<option>-keep class * implements
org.eclipse.core.runtime.IPlatformRunnable
</option>
<option>-dontshrink</option>
<option>-dontoptimize</option>
<option>-dontpreverify</option>
<option>-obfuscationdictionary keywords</option>
<option>-classobfuscationdictionary keywords</option>
<option>-keeppackagenames **view**</option>
</options>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/jce.jar</lib>
</libs>
</configuration>
</plugin>
Maybe will be useful for somebody, I changed from <phase>install</phase>
to package, and right now everything is working fine. It looklike this that with tycho jar is putting into p2 repository before install maven phase.