Using Proguard with Maven in libs in java swing

Asked

Viewed 67 times

0

I obfuscated my jar using the proguard-Maven-plugin plugin, pom.xml and the configuration are these:

 <build>
    <plugins>
        <plugin>
            <groupId>com.github.wvengen</groupId>
            <artifactId>proguard-maven-plugin</artifactId>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>proguard</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <maxMemory>1024m</maxMemory>
                <proguardInclude>${basedir}/proguard.conf</proguardInclude>
                <libs>
                    <lib>${java.home}/lib/rt.jar</lib>
                    <lib>${java.home}/lib/jsse.jar</lib>
                </libs>
            </configuration>
        </plugin>
    </plugins>
</build>

The proguard.conf file where the proguard settings are:

-keep public class br.com.myapp.myapp.Main {
    public static void main(java.lang.String[]);
}

With this I can obfuscate my source code in the jar generated by the compilation, but I can no longer use the jar as lib in my other projects, because the classes disappear.

My question is: how do I obfuscate the jar but it may still have its methods used by other applications such as an external lib in a swing application?

Documentation of the plugin.

Thanks in advance.

  • Give it a shot that configuration solves the problem.

  • @Renan this configuration works, but if I hide the methods I use in another project, these are still inaccessible.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.