After I confuse a Spring mvc+mybatis project with proguard, what happens when there is no proper class file in the war file?

this is a maven project for IDEA.

after I unzipped the project name target project name-1.0-small.war file, the xml file is removed from the WEB-INFclasses package name, which is empty.

build Information:
[proguard] Note: there were 84 unkept descriptor classes in kept class members.
[proguard] You should consider explicitly keeping the mentioned classes
[proguard] (using"- keep").
[proguard] ( http://proguard.sourceforge.n.
[proguard] Note: there were 9 unresolved dynamic references to classes or interfaces.
[ Proguard] You should check if you need to specify additional program jars.
[proguard] ( http://proguard.sourceforge.n.
[proguard] Note: there were 5 class casts of dynamically created class instances.
[proguard] You might consider explicitly keeping the mentioned classes and/or
[proguard] their implementations (using"- keep").
[ Proguard] ( http://proguard.sourceforge.n.
[proguard] Note: there were 65 accesses to classmembers by means of introspection.
[proguard] You should consider explicitly keeping the mentioned classmembers
[proguard] (using"- keep" or"- keepclassmembers").
[proguard] ( [proguard] Ignoring unused library classes.
[proguard] Original number of library classes: 19879
[proguard] Final number of library classes: 19879
[proguard] Setting target versions.
[proguard] Printing kept classes, Fields, and methods.
[proguard] Warning: there were 10914 unresolved references to classes or interfaces.
[proguard] You may need to add missing library jars or update their versions.
[proguard] If your code works fine without the missing classes, You can suppress
[proguard] the warnings with"- dontwarn" options.
[proguard] (
http://proguard.sourceforge.n.
[proguard] Warning: there were 203 unresolved references to program class members.
[proguard] Your input classes appear to be inconsistent.
[proguard] You may need to recompile the code .
[proguard] ( http://proguard.sourceforge.n.
[proguard] Warning: there were 26 unresolved references to library class members.
[proguard] You probably need to update the library versions.
[proguard] ( http://proguard.sourceforge.n.
[proguard] Inlining subroutines.
[proguard] Obfuscating.
[proguard] Printing mapping to [C:UserswinIdeaProjects project name targetproguard_map.txt].
[proguard] Preverifying.
[proguard] Writing output.
[proguard] Preparing output war [C:UserswinIdeaProjects Project name target Project name-1.0-small.war]
[proguard] Copying resources from program war [C:UserswinIdeaProjects Project name target item Directory name-1.0.war] (filtered)
[INFO]
[INFO]-maven-install-plugin:2.4:install (default-install) @ project name-
[INFO] Installing C:UserswinIdeaProjects project name target project name-1.0.war to C:Userswin.m2repositorycomsmart project name 1.0 project name-1.0.war
[INFO] Installing C:UserswinIdeaProjects project name pom.xml to C:Userswin.m2repositorycomsmart project name 1.0 project name Name-1.0.pom
[INFO]--
[INFO] BUILD SUCCESS
[INFO]- -

contents of proguard.conf file:

< H1 > ignore warnings < / H1 >

-ignorewarnings

< H1 > print processing information, stack information will be printed on failure < / H1 >

-verbose

< H1 > keep the directory structure < / H1 >

-keepdirectories

< H1 > do not confuse generics, thrown exceptions, annotation defaults, original line numbers, etc. < / H1 >

-keepattributes Signature,Exceptions, Annotation , InnerClasses,Deprecated,EnclosingMethod

< H1 > do not confuse package name and class name < / H1 >

-keeppackagenames com.company.appname.**

< H1 > keep the public and protected methods from being confused < / H1 >

-keep public class * {

  public protected *;

}

< H1 > reserved comments are not confused < / H1 >

-keep public @ interface * {

** default (*);

}

< H1 > keep enumerated classes from being confused < / H1 >

-keepclassmembers enum * {

public static **[] values();
public static ** valueOf(java.lang.String);

}

< H1 > keep dependency injection unconfused < / H1 >

-keepclassmembers class * {

@org.springframework.beans.factory.annotation.Autowired *;
@javax.annotation.Resource *;

}

< H1 > keep RMI calls from being confused < / H1 >

-keep class * implements java.rmi.Remote {

<init>(java.rmi.activation.ActivationID, java.rmi.MarshalledObject);

}

< H1 > keep the JavaBean from being confused < / H1 >

-keepclassmembers class * implements java.io.Serializable {

static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();

}

< H1 > prevent class names from being marked as final < / H1 >

-optimizations! class/marking/final

-target 1.8-sharp-sharp specifies the java version number
-dontshrink-sharp-sharp is enabled by default. Here, shrink, is turned off, that is, unused classes / members are not deleted.
-dontoptimize-sharp-sharp is enabled by default. After bytecode-level optimization
-useuniqueclassmembernames-sharp-sharp adopts a unique policy
-adaptclassstrings-sharp-sharp to obfuscate class names, Use places such as Class.forName ("className") to replace
-dontusemixedcaseclassnames-sharp-sharp confusion without generating mixed case class names. By default, you can mix uppercase and lowercase

.

pom.xml file:

    <plugin>
        <groupId>com.github.wvengen</groupId>
        <artifactId>proguard-maven-plugin</artifactId>
        <version>2.0.14</version>
        <dependencies>
            <dependency>
                <groupId>net.sf.proguard</groupId>
                <artifactId>proguard-base</artifactId>
                <version>5.3.3</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>proguard</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <proguardVersion>5.3.3</proguardVersion>
            <obfuscate>true</obfuscate>
            <injar>-1.0.war</injar>
            <outjar>-1.0-small.war</outjar>
            <outputDirectory>${project.build.directory}</outputDirectory>
            <proguardInclude>${project.basedir}/proguard.conf</proguardInclude>
            <libs>
                <!-- Include main JAVA library required.-->
                <lib>${java.home}/lib/rt.jar</lib>
                <!-- Include crypto JAVA library if necessary.-->
                <lib>${java.home}/lib/jce.jar</lib>
            </libs>
        </configuration>
    </plugin>
Apr.09,2021
Menu