tags:

views:

312

answers:

1

My application jar contains classes from swing-layout.jar which contains free layout manager for java 1.5. During obfuscation process i get a lot of warnings such as

[proguard] Note: org.jdesktop.layout.SwingLayoutStyle accesses a field 'INDE
NT' dynamically                                                             
 [proguard]       Maybe this is program field 'org.jdesktop.layout.LayoutStyl
e { int INDENT; }'   

I would like proguard to leave org.jdesktop classes alone, and get rid of the warnings i tried

      -keeppackagenames org.jdesktop.*

but it did not work?

+2  A: 

You want, I think,

-keep org.jdesktop.**

Note the two stars. From the documentation:

*   matches any part of a name not containing the package separator or directory separator.
**  matches any part of a name, possibly containing any number of package separators or directory separators.

-keeppackagenames just keeps... package names! You want -keep, which protects the names of things in packages.

Jonathan Feinberg
i noticed that after asking the question but ** produces the same error messages.
Hamza Yerlikaya
Oh... You want -keep, not -keeppackagenames. I've edited to reflect this.
Jonathan Feinberg