Java Mailing List Archive

http://www.java2.5341.com/

Home » Maven Users List »

Issue with ProGuard Maven plugin.

Mikel Cármenes Cavia

2008-06-30

Replies: Find Java Web Hosting

Author LoginPost Reply
Hey guys,

I am trying to obfuscate my code by using Maven's ProGuard plugin.

This is the section I added to my POM file to activate the plugin:
...
<plugin>
          <groupId>com.pyx4me</groupId>
          <artifactId>proguard-maven-plugin</artifactId>
          <executions>
            <execution>
              <phase>package</phase>
              <goals><goal>proguard</goal></goals>
            </execution>
          </executions>
          <configuration>
            <obfuscate>true</obfuscate>
            <injar>${project.build.finalName}.jar</injar>
            <outjar>${project.build.finalName}-small.jar</outjar>

<outputDirectory>${project.build.directory}</outputDirectory>

<proguardInclude>${basedir}/proguard.conf</proguardInclude>
            <libs>
               <lib>${java.home}/lib/rt.jar</lib>
            </libs>
       <options>
               <option>-dontshrink</option>
               <option>-dontnote</option>
            </options>
          </configuration>
   </plugin>
...
And this is what I get at the very end of my packaging:

...
[proguard] Reading library jar [C:\Documents and
Settings\Mikel\.m2\repository\mysql-connector-java\mysql-connector-java\5.0.3\mysql-connector-java-5.0.3.jar]
[proguard] Reading library jar [C:\Documents and
Settings\Mikel\.m2\repository\poi\poi\2.5.1-final-20040804\poi-2.5.1-final-20040804.jar]
[proguard] Reading library jar [C:\Documents and
Settings\Mikel\.m2\repository\servlet\servlet\4.1.31\servlet-4.1.31.jar]
[proguard] Reading library jar [C:\Documents and
Settings\Mikel\.m2\repository\swingx\swingx\0.9.3\swingx-0.9.3.jar]
[proguard] Reading library jar [C:\Program
Files\Java\jdk1.6.0_06\jre\lib\rt.jar]
[proguard] Error: You have to specify '-keep' options for the shrinking
step.
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Obfuscation failed (result=1)
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 33 seconds
[INFO] Finished at: Mon Jun 30 15:19:07 ADT 2008
[INFO] Final Memory: 15M/29M
[INFO]
------------------------------------------------------------------------


Does anybody know what might be causing this? Thanks!
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.