Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proguard obfuscate only /WEB-INF/classes/**/*.class files in my war

Tags:

java

proguard

war

I want to obfuscate only the server-side code (webapp.war:/WEB-INF/classes/**).

How can I do this using proguard maven plugin ?

like image 358
Beto Neto Avatar asked Jul 21 '15 00:07

Beto Neto


1 Answers

ProGuard offers options of filters for many different aspects of the configuration.
A filter is a list of comma-separated names that can contain wildcards. Only names that match an item on the list pass the filter.

You can use <outFilter> to apply ProGuard to output jar. outFilter is optional parameter to apply ProGuard classpathentry filters to output jar.
In your case I guess below filter should work. Off course you can add additional comma separated filters.(ignore the space in between forward splash and asterik mark)

<outFilter>**/WEB-INF/classes/ **.class</outFilter>
like image 183
Viraj Nalawade Avatar answered Oct 12 '22 23:10

Viraj Nalawade