Guardsquare/proguard

When I use Spring Framework 6.x, I can mix up packaging normally, but the controller reports an error after running it

xiaobaogeit opened this issue · 1 comments

use:

<plugin>
    <groupId>com.github.wvengen</groupId>
    <artifactId>proguard-maven-plugin</artifactId>
    <version>2.6.1</version>
    ...
<plugin>

error:

Name for argument of type [java.lang.String] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.

Spring prompts for use:
https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <parameters>true</parameters>
    </configuration>
</plugin>

I had a similar problem after upgrading SpringBoot (to 3.3). For me I needed to add -keepattributes MethodParameters to my proguard config in combination with the compiler '-parameters' flag seems to get it working