Skip to content

Honor runtime classpath exclusions during AOT processing - #51383

Open
gregjotau wants to merge 1 commit into
spring-projects:mainfrom
gregjotau:aot-runtime-classpath-exclusions
Open

Honor runtime classpath exclusions during AOT processing#51383
gregjotau wants to merge 1 commit into
spring-projects:mainfrom
gregjotau:aot-runtime-classpath-exclusions

Conversation

@gregjotau

Copy link
Copy Markdown

processAotClasspath and processTestAotClasspath are assembled from the parent configurations of their respective runtime classpaths so that development-only dependencies can be omitted. As a result, exclusion rules declared directly on runtimeClasspath or testRuntimeClasspath are currently lost.

This can make AOT processing evaluate classpath conditions differently from the packaged application. For example, excluding aspectjweaver from runtimeClasspath still exposes it to AOT processing, which selects AnnotationAwareAspectJAutoProxyCreator; the AOT-processed application then fails at runtime because AspectJ is correctly absent.

Copy the direct runtime classpath exclusion rules immediately before resolving the AOT processing classpath. Doing this lazily honors exclusions configured after the AOT plugin is applied. Integration tests cover both application and test AOT classpaths on the supported Gradle versions.

Verified with:

./gradlew :build-plugin:spring-boot-gradle-plugin:check

Signed-off-by: GT <gregjotau@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants