Nimelrian
01/04/2019, 7:07 PM...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modelService' defined in file [G:\src\java\afraid\model\build\classes\kotlin\main\de\nimelrian\afraid\model\ModelService.class]: Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: Resource not found in classpath: kotlin/coroutines/coroutines.kotlin_builtins
Caused by: java.lang.IllegalStateException: Resource not found in classpath: kotlin/coroutines/coroutines.kotlin_builtins
...
I have a reproduction repository here: https://github.com/Nimelrian/kotlin-1.3-spring-test-error
Running .\gradlew build
should show the failing test.
Gradle also shows some warnings regarding differing versions, so I tried pinning the versions using the dependency management plugin, which makes both the warnings and the test error disappear (See the potential-fix
branch in the repo). I do wonder whether this is the correct way though.Czar
01/04/2019, 7:46 PMext['kotlin.version'] = kotlinVersion
somewhere under build script.
This tells spring dependency management to use specific version of KotlinCzar
01/04/2019, 7:51 PMapply plugin: 'org.springframework.boot'
The boot plugin is smart enough to detect Kotlin plugin and align its own Kotlin dependency version with Kotlin plugin's. Spring dependency-management plugin isn't that smart (or doesn't care) metaphorically speaking 🙂Nimelrian
01/04/2019, 7:55 PMCzar
01/04/2019, 8:00 PMNimelrian
01/04/2019, 8:01 PMCzar
01/04/2019, 8:04 PMdependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") {
bomProperty 'kotlin.version', kotlinVersion
}
}
}
Czar
01/04/2019, 8:06 PMext
systemCzar
01/04/2019, 8:07 PMext['something']
needs to be at least commented, to be understood without previous knowledge.Nimelrian
01/04/2019, 8:08 PM