Repository navigation
Make aopalliance dependency optional - #1543
Merged
Merged
Conversation
Make aopalliance an optionalApi dependency in micrometer-tracing to prevent split-package errors and classpath conflicts in JPMS/modular environments when used alongside spring-aop. Add non-published integration test modules covering Spring AOP, AspectJ standalone, JPMS module path resolution, and non-AspectJ setups. Closes micrometer-metrics#1536
Different JDK versions may report either org.aopalliance.aop or org.aopalliance.intercept first when encountering a split package.
Exclude 'integration-test-' projects rather than 'integration-test' to ensure micrometer-tracing-integration-test continues to be published and included in the BOM while excluding the newly added build-time test modules.
shakuzen
commented
Sep 1, 2026
Move non-published integration test modules under a new 'internal' directory to distinguish them from published test modules under 'micrometer-tracing-tests'. Add explanatory comments for the 'integration-test-' exclusions in build.gradle and the BOM.
Proper standalone AspectJ (LTW/CTW) integration testing requires dedicated runtime configuration and constructor enhancements, which is better scoped in a separate follow-up task.
micrometer-tracing-test and spring-context are not required since the test only verifies module path resolution with spring-aop and micrometer-tracing.
shakuzen
marked this pull request as ready for review
September 2, 2026 07:17
shakuzen
commented
Sep 2, 2026
| api libs.aopAlliance | ||
|
|
||
| // aspects | ||
| optionalApi libs.aopAlliance |
Member
Author
There was a problem hiding this comment.
This is the primary change. Everything else is testing.
Member
Author
|
I did try to add AspectJ tests without Spring AOP, but I think we need some changes to enable that (e.g. there's no default no-arg constructor on |
jonatan-ivanov
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aopallianceanoptionalApidependency inmicrometer-tracing/build.gradlerather than mandatoryapi, preventing split-package errors on the Java module path (JPMS) and non-deterministic classloading conflicts when used with Spring AOP.integration-test-from Maven publishing and the BOM while preserving publishing formicrometer-tracing-integration-test.internal/(build-time only) verifying behavior across classpath/modulepath setups:internal/micrometer-tracing-integration-test-spring-aop-with-aspectj: verifies Spring AOP + AspectJ (@Aspect) proxying usingspring-aop's bundledorg.aopallianceinterfaces withoutaopalliance:1.0.internal/micrometer-tracing-integration-test-spring-aop-no-aspectj: demonstrates failures and tag extraction limitations when attempting aspect proxying withoutaspectjweaver.internal/micrometer-tracing-integration-test-jpms: tests JPMS module path resolution and demonstrates split-package failures when transitiveaopallianceis present withspring.aop.Closes #1536
Test plan
./gradlew checkpasses on all modules.micrometer-tracing-integration-test-jpms.publishandpublishToMavenLocaltasks are not added for internal integration test modules.