Spring WARNING: Using deprecated ‘-debug‘ fallback for parameter name resolution. Compile the affec

8月 17, 2024 8:27:53 下午 org.springframework.core.LocalVariableTableParameterNameDiscoverer inspectClass
WARNING: Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.xxxx.xxxx

遇到这个问题的时候,我网上查了很久,各种尝试,最后没了又有了,现在又没了,但是好像代码是一样的呀。

Spring这个问题,现在是不报错了。

如果你的报错没有消失,那就在pom.xml中

<parameters>true</parameters>和附近的注释行以及在spring版本之间反复横跳看看吧。

1,升级6.0.3,我用先前用的spring-core  6.0.2

2,然后在maven的pom.xml添加<parameters>true</parameters>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
<!--                    <debug>false</debug>-->
                    <parameters>true</parameters>
<!--                    <compilerArgs><arg>-parameters</arg></compilerArgs>-->

                </configuration>
            </plugin>
        </plugins>
    </build>

这一步可能比较关键

完整:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.xxx</groupId>
    <artifactId>prj-name</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>6.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>6.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>6.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>6.0.2</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
    </dependencies>



    <properties>
        <maven.compiler.source>18</maven.compiler.source>
        <maven.compiler.target>18</maven.compiler.target>
        <project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
<!--                    <debug>false</debug>-->
                    <parameters>true</parameters>
<!--                    <compilerArgs><arg>-parameters</arg></compilerArgs>-->

                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

编辑完不要忘了刷新依依赖。

一直查,了解到这个问题好像是v6版本的bug,很多人从v5.5升级到v6.0.2就会出现这个问题,,貌似是spring维护人员说要在6.0.3解决bug。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值