简体   繁体   English

如何 spring-boot 2.4.0 和 kotlin 1.4.20

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

I am trying to build a spring-boot Microservice.我正在尝试构建一个 spring-boot 微服务。 The build is using releasee 2.4.0 of spring-boot.该版本使用 spring-boot 的 releasee 2.4.0。 I am trying to compile this build with the new release 1.4.20 of kotlin.我正在尝试使用 kotlin 的新版本 1.4.20 编译此版本。

How can I build this without failures?我怎样才能在没有失败的情况下构建它? Try to create a kotlin Microservice with start.spring.io .尝试使用start.spring.io创建一个 kotlin 微服务。 Edit the pom to use the newest kotlin release...编辑 pom 以使用最新的 kotlin 版本...

When building:搭建时:

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
...

If you choose kotlin as main language (as one should) and picks java 15, one get the following error:如果您选择 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 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

The error seemed to be a bug only visible on Mac OS Big Sur (intel version), but was solved by updating to kotlin release 1.4.21该错误似乎是仅在 Mac OS Big Sur(英特尔版本)上可见的错误,但已通过更新到 kotlin 版本 1.4.21 解决

updating kotlin version works for me.更新 kotlin 版本对我有用。

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

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