简体   繁体   中英

How to spring-boot 2.4.0 and kotlin 1.4.20

I am trying to build a spring-boot Microservice. The build is using releasee 2.4.0 of spring-boot. I am trying to compile this build with the new release 1.4.20 of kotlin.

How can I build this without failures? Try to create a kotlin Microservice with start.spring.io . Edit the pom to use the newest kotlin release...

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:

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

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

updating kotlin version works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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