Kotlin classes are not present in Spring Boot source JARs.
For example, there is no org/springframework/boot/SpringApplicationExtensionsKt.class
(which contains runApplication
function) in spring-boot-2.2.2.RELEASE-sources.jar
.
Comment From: bclozel
It seems we can't have multiple source directories for the maven-source-plugin
, and adding an extra one is done for the whole build and not just for the sources jar generation phase.
I'm not sure how to handle this - any idea @sdeleuze ?
Comment From: wilkinsona
This has been fixed in 2.3 by the move to Gradle. We're not aware of a solution with Maven so we'll have to live with things as they are in 2.1.x and 2.2.x.
Comment From: chantellosejo
So....what exactly are we supposed to do then if this is preventing us from running our application? Is there a version for Maven that we can use?
Comment From: wilkinsona
Can you explain how missing Kotlin source code is preventing your from running your application? Unfortunately, there's no way for a Maven-based build to package Kotlin and Java source in its source jar. Spring Boot 2.3 fixes this for users of any build system as the source jars that we publish in 2.3 contain both Java and Kotlin source.