I would like to use proguard for my Spring MVC (not boot) application that is packaged as .WAR and loaded into tomcat server. I use proguard-maven-plugin to create obfuscated .WAR file. However the .WAR file created by proguard seems empty, only the class structure is there, but no classes at all.
My pom.xml config:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>8</source>
<target>8</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<obfuscate>true</obfuscate>
<injar>${project.build.finalName}.war</injar>
<outjar>${project.build.finalName}-small.war</outjar>
<outputDirectory>${project.build.directory}</outputDirectory>
<injarNotExistsSkip>true</injarNotExistsSkip>
<options>
<option>-allowaccessmodification</option>
<option>-dontoptimize</option>
<option>-dontskipnonpubliclibraryclasses</option>
<option>-keepnames interface **</option>
<option>-keepparameternames</option>
<option>-adaptclassstrings</option>
<option>-keepdirectories</option>
<option>-dontshrink</option>
<option>-dontnote</option>
<option>-dontwarn</option>
<option>-ignorewarnings</option>
<option>-keepattributes
Exceptions,
InnerClasses,
Signature,
Deprecated,
SourceFile,
LineNumberTable,
*Annotation*,
EnclosingMethod
</option>
<option>-keep interface * extends * { *; }</option>
<option>-keep class module-info</option>
<option>-keepattributes Module*</option>
<option>-keep @org.springframework.transaction.annotation.Transactional class *</option>
<option>-keep @org.springframework.stereotype.Service class *</option>
<option>-keep @org.springframework.stereotype.Controller class *</option>
<option>-keep @org.springframework.beans.factory.annotation.Autowired class *</option>
<option>-keep @org.springframework.web.bind.annotation.ResponseBody class *</option>
<option>-keep @org.springframework.web.bind.annotation.RequestMapping class *</option>
<option>-keep @org.springframework.stereotype.Repository class *</option>
<option>-keep @javax.annotation.Resource class *</option>
<option>-keep @javax.persistence.Entity class *</option>
</options>
<libs>
<lib>${java.home}/jmods/java.base.jmod</lib>
<lib>${java.home}/jmods/java.logging.jmod</lib>
<lib>${java.home}/jmods/java.rmi.jmod</lib>
<lib>${java.home}/jmods/java.xml.jmod</lib>
<lib>${java.home}/jmods/java.se.jmod</lib>
<lib>${java.home}/jmods/java.se.ee.jmod</lib>
<lib>${java.home}/jmods/java.sql.jmod</lib>
<lib>${java.home}/jmods/java.desktop.jmod</lib>
<lib>${java.home}/jmods/java.management.jmod</lib>
<lib>${java.home}/jmods/java.naming.jmod</lib>
<lib>${java.home}/jmods/java.activation.jmod</lib>
<lib>${java.home}/jmods/java.prefs.jmod</lib>
<lib>${java.home}/jmods/java.scripting.jmod</lib>
<lib>${java.home}/jmods/java.management.rmi.jmod</lib>
<lib>${java.home}/jmods/java.instrument.jmod</lib>
<lib>${java.home}/jmods/java.datatransfer.jmod</lib>
<lib>${java.home}/jmods/java.compiler.jmod</lib>
</libs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>