Beto Neto
Beto Neto

Reputation: 4112

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

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

How can I do this using proguard maven plugin ?

Upvotes: 16

Views: 1984

Answers (1)

Viraj Nalawade
Viraj Nalawade

Reputation: 3227

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>

Upvotes: 12

Related Questions