繁体   English   中英

如何 spring-boot 2.4.0 和 kotlin 1.4.20

[英]How to spring-boot 2.4.0 and kotlin 1.4.20

我正在尝试构建一个 spring-boot 微服务。 该版本使用 spring-boot 的 releasee 2.4.0。 我正在尝试使用 kotlin 的新版本 1.4.20 编译此版本。

我怎样才能在没有失败的情况下构建它? 尝试使用start.spring.io创建一个 kotlin 微服务。 编辑 pom 以使用最新的 kotlin 版本...

搭建时:

Execution compile of goal org.jetbrains.kotlin:kotlin-maven-plugin:1.4.20:compile failed: A required class was missing while executing org.jetbrains.kotlin:kotlin-maven-plugin:1.4.20:compile: kotlin/reflect/KDeclarationContainer
...

如果您选择 kotlin 作为主要语言(应该)并选择 java 15,则会出现以下错误:

Compilation failure
[ERROR] Unknown JVM target version: 15
[ERROR] Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14

There is something fundamentally wrong with the spring-boot configuration provided from start.spring.io as the target of the new kotlin version 1.4.20 is java 15: what's new in kotlin 1.4.20

该错误似乎是仅在 Mac OS Big Sur(英特尔版本)上可见的错误,但已通过更新到 kotlin 版本 1.4.21 解决

更新 kotlin 版本对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM