You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Transitive aopalliance dependency conflicts with spring-aopΒ #1536
AOP Alliance is an abandoned project and was compiled with Java 1.4. I think it is save to assume that it is abandoned and will no longer be developed. Nobody considers the library either, as far as I know.
To make things worse, Spring bundles and publishes their own version of aopalliance with an automatic module name and some modifications. This can break Java tooling and on the class path, it is random which one you observe.
Could you either:
Remove this entirely.
Replace the dependency with spring-aop.
Remove this and offer two bridge versions where you subclass with spring-aop in one version and with aopalliance in the other one. You can also ship one version without the interfaces. This would need subclasses for the interface implementations.
Without this, micrometer-tracing can currently lead to annoying bugs and makes it difficult to use automatic modules on the module path as this breaks package exclusivity, what it should since this is a shadowing bug.
Thanks for bringing this to our attention. I think this is a byproduct of copied code from Spring Cloud Sleuth at the inception of Micrometer Tracing. I'm surprised no one has reported it before, as far as I remember. We'll have to think of the right way to migrate away from the dependency, considering backward compatibility concerns. Ideally, when we migrated the code to here, we would have made the aspect-related code follow the same pattern as in Micrometer, where we don't ship a dependency. Although, I do remember some users asked several years ago specifically for AOP Alliance support in Micrometer: micrometer-metrics/micrometer#1048.
I think the only way to do this, would be to remove the interfaces, and then to create another jar that depends on this library, and that creates subclasses with the interfaces implemented. This way, any user can choose to drag in the AOP Alliance, which I would recommend you to default to the maintained Spring AOP version.
The method signatures can stay, so the classes will only loose their type, but not their shape. Of course, this is a breaking change anyways. With the minimal spread of AOP Alliance, you might however drop the dependency altogether.
For a short term solution: You could switch out AOP Alliance with Spring AOP. Then Maven only resolves one version of the packages for users of Spring, which I would assume is the most common use case. This does not change binaries at all and users can exclude Spring AOP and include AOP Alliance if they wanted to. This is also how I solve it right now, just the other way around.
I've opened #1543 to make the aopalliance dependency optional (the same as the aspectj dependency). Everything should continue to work for Spring users because of the included aopalliance classes in spring-aop. It's only SpanAspect users who aren't using spring-aop that might be affected. From my limited research, I'm hopeful that's exceedingly few users. They can add the aopalliance dependency back to their application as a quick remedy. It's not ideal for us to switch a dependency to optional in a minor release, but the current situation is also not ideal and this seems minimally impactful in practice.
Activity
shakuzen commentedon Aug 28, 2026
Thanks for bringing this to our attention. I think this is a byproduct of copied code from Spring Cloud Sleuth at the inception of Micrometer Tracing. I'm surprised no one has reported it before, as far as I remember. We'll have to think of the right way to migrate away from the dependency, considering backward compatibility concerns. Ideally, when we migrated the code to here, we would have made the aspect-related code follow the same pattern as in Micrometer, where we don't ship a dependency. Although, I do remember some users asked several years ago specifically for AOP Alliance support in Micrometer: micrometer-metrics/micrometer#1048.
raphw commentedon Aug 28, 2026
I think the only way to do this, would be to remove the interfaces, and then to create another jar that depends on this library, and that creates subclasses with the interfaces implemented. This way, any user can choose to drag in the AOP Alliance, which I would recommend you to default to the maintained Spring AOP version.
The method signatures can stay, so the classes will only loose their type, but not their shape. Of course, this is a breaking change anyways. With the minimal spread of AOP Alliance, you might however drop the dependency altogether.
For a short term solution: You could switch out AOP Alliance with Spring AOP. Then Maven only resolves one version of the packages for users of Spring, which I would assume is the most common use case. This does not change binaries at all and users can exclude Spring AOP and include AOP Alliance if they wanted to. This is also how I solve it right now, just the other way around.
[-]Remove aopalliance dependency[/-][+]Transitive aopalliance dependency conflicts with spring-aop[/+]shakuzen commentedon Sep 2, 2026
I've opened #1543 to make the aopalliance dependency optional (the same as the aspectj dependency). Everything should continue to work for Spring users because of the included aopalliance classes in spring-aop. It's only SpanAspect users who aren't using spring-aop that might be affected. From my limited research, I'm hopeful that's exceedingly few users. They can add the aopalliance dependency back to their application as a quick remedy. It's not ideal for us to switch a dependency to optional in a minor release, but the current situation is also not ideal and this seems minimally impactful in practice.
Make aopalliance dependency optional (#1543)
shakuzen commentedon Sep 3, 2026
I opened #1546 to add a note to the reference documentation about the dependencies being optional but needed for using the SpanAspect.
Document SpanAspect dependency requirements (#1546)