Skip to content

踩坑记录

DefaultParameterNameDiscoverer失效问题

一般是因为编译class没有保留参数名,需要改构建配置,编译时添加-parameters参数,eg:

xml
<!-- Maven 配置 -->
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>11</source>
                <target>11</target>
                <compilerArgs>
                    <arg>-parameters</arg>
                </compilerArgs>
            </configuration>
        </plugin>
    </plugins>
</build>

Released under the MIT License.