Hi All. I am getting build errors when using the f...
# spring
g
Hi All. I am getting build errors when using the following plugins:
Copy code
id("io.spring.dependency-management") version "1.0.10.RELEASE"
id("org.springframework.boot") version "2.3.3.RELEASE"
Even without any Spring dependencies declared. If I don't include the dependency-management plugin, the errors do not occur. The errors are:
Copy code
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    C:/Users/Greg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.4.10/998caa30623f73223194a8b657abd2baec4880ea/kotlin-stdlib-jdk8-1.4.10.jar (version 1.4)
    C:/Users/Greg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.72/3adfc2f4ea4243e01204be8081fe63bde6b12815/kotlin-stdlib-jdk7-1.3.72.jar (version 1.3)
    C:/Users/Greg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.72/8032138f12c0180bc4e51fe139d4c52b46db6109/kotlin-stdlib-1.3.72.jar (version 1.3)
    C:/Users/Greg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.10/6229be3465805c99db1142ad75e6c6ddeac0b04c/kotlin-stdlib-common-1.4.10.jar (version 1.4)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
and:
Copy code
e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (8,13) in C:/Users/Greg/Documents/git/test/src/jsMain/kotlin/client.kt
        at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
Long stack trace omitted, followed by
Copy code
Caused by: java.lang.NoSuchMethodError: 'kotlin.sequences.Sequence kotlin.sequences.SequencesKt.flatMapIterable(kotlin.sequences.Sequence, kotlin.jvm.functions.Function1)'
        at org.jetbrains.kotlin.resolve.calls.components.CollectionTypeVariableUsagesInfo.getDependentTypeParameters(ResolutionParts.kt:393)
        at org.jetbrains.kotlin.resolve.calls.components.CollectionTypeVariableUsagesInfo.getDependentTypeParameters$default(ResolutionParts.kt:389)
This was with a new Multiplatform Kotlin project created in IntelliJ, but just adding those 2 plugins to the build.gradle.kts. I think this is an issue with the Spring dependency-management plugin. I am not sure if this is the best place to ask for help with this, if it is a bug or something I am doing wrong. If I should file a bug report in another Spring channel, please advise where that should be. Thanks!
t
you can try to add
kotlin.version
to your
gradle.properties
file to tell spring which version to use, but spring will support kotlin officially in version 5.4 (out yesterday as independent dependency but bundled in boot 2.4). for us, kotlin 1.4 is working, but our project is jvm only
g
That solved the problem. Thanks for the help.
👍 1