springboot3.2.0报Name for argument of type [java.lang.String] not specified, and parameter name infb

项目依赖依赖 spring-boot-stareter-parent 会自行设置 Option "-parameters" 相关参数,因为我没有直接使用spring-boot-stareter-parent ,需要自行配置一下其他的maven打包参数
JDK21 SpringBoot 3.4.3

问题

I found this because Compile Option "-parameters" is disabled.
因为编译选项“-参数”被禁用。
-parameters
Generates metadata for reflection on method parameters. Stores formal parameter names of constructors and methods in the generated class file so that the method java.lang.reflect.Executable.getParameters from the Reflection API can retrieve them.
为方法参数的反射生成元数据。在生成的类文件中存储构造函数和方法的正式参数名,以便来自反射API的方法java.lang.reflect.Executable.getParameters可以检索它们

IDEA配置——方法1

notion image

Pom.xml build——方法2

先设置了<parameters>true</parameters>,运行aop报错,然后又设置了compilerArgs -parameters
 
这可确保使用 -parameters 标志编译代码,从而使参数名称在运行时可用。
如果不使用父 pom,也可以在自己的pom中直接添加插件配置来配置

注意

更新完成记得maven clean,然后重新编译运行,否则也是不生效的

神奇的IDEA

我新增pom后找不到包,安装也下不下来
关闭idea重开,然后运行clean install才能用
Loading...
文章列表
王小扬博客
Git
Elasticsearch
Apollo
产品
Think
生活技巧
软件开发
计算机网络
CI
DB
设计
缓存
Docker
Node
操作系统
Java
大前端
Nestjs
其他
PHP