【SpringBoot源码】记一次SpringBoot源码问题

问题描述

搭建SpringBoot源码环境时,在spring-boot-test目录下启动一个子项目,Kotlin报错:

Warning:Kotlin: Language version 1.4 is experimental, there are no backwards compatibility guarantees for new language and library features
D:\springboot\spring-boot-2.2.x\spring-boot-project\spring-boot-autoconfigure\src\test\kotlin\org\springframework\boot\autoconfigure\diagnostics\analyzer\KotlinNoSuchBeanFailureAnalyzerNoKotlinReflectTests.kt
Error:(39, 41) Kotlin: 'use((T) -> R): R' is only available since Kotlin 1.3.50 and cannot be used in Kotlin 1.4

The compiler bundled to Kotlin plugin (1.3.21) is older than external compiler used for building modules:
spring-boot-autoconfigure (1.4.10)
This may cause different set of errors and warnings reported in IDE.
Update  Ignore (show balloon)

问题原因

Kotlin版本问题,IDEA自带的Kotlin版本为1.3.21,而SpringBoot源码使用的Kotlin版本为1.4+。

解决方案

Kotlin版本升级

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容