解决:
将spring-context.gradle文件的
下面这一行
optional(project(":spring-instrument"))
修改为
api(project(":spring-instrument"))
参照了以下链接:
Spring源码编译Java: 找不到符号 InstrumentationSavingAgent_雪子的博客-CSDN博客
为什么改成api 而不是compile 是因为compile已过时,已被 implementation 和api 取代。参照了以下链接:
implementation、api、compileOnly区别详解_XeonYu的博客-CSDN博客_compileonly implementation