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. This commit
works around the problem by repairing the damage and setting the
attribute back to java-runtime again.
Fixes gh-46397
Prior to this change, versions in the dev and production classpaths
could differ. These differing versions could result in a transitive
dependency that should have been present in both development and
production only being present in the former. This would likely
result in failures at runtime.
This commit aligns the versions by adding constraints to the
production runtime classpath for each dependency in the runtime
classpath.
Closes gh-46043
When testing with Gradle 7.6, junit-platform-launcher won't be
on the test runtime classpath unless it's declared as a dependency.
When testing with Gradle 8.x the dependency is added implicitly but
starting with Gradle 8.3 relying on this will result in a warning.
When junit-platform-launcher is absent, a failure occurs when testing
with Gradle as the class loader structure is such that JUnit tries
to load any test execution listeners, finds the listener declared in
spring-boot-actuator-autoconfigure but cannot then load the
implemented TestExecutionListener interface.
This problem is addressed by augmenting the component metadata for
spring-boot-starter-test to add a dependency on
junit-platform-launcher. This addresses the problem with
spring-boot-actuator-autoconfigure while also addressing a warning
with Gradle 8.3+.
Closes gh-43340