Compilation of AOT-generated source code requires runtime dependencies to be on the classpath. This is necessary as a class from a runtime dependency may appear in the signature of a generated method that defines a bean. To accomplish this Boot's AOT plugin sets the org.gradle.usage
attribute of the compile classpath configurations of the aot
and aotTest
source sets to java-runtime
.
When the Kotlin plugin is applied after Boot's AOT plugin it breaks this arrangement by setting org.gradle.usage
to java-api
. There doesn't appear to be a way to prevent it from messing with the aot
and aotTest
source sets despite them not using Kotlin. We can work around this problem by repairing the damage and setting the attribute back to java-runtime
again.