Spring Framework 6.1.7 introduces a significant change in how "@Aspect classes" are handled. This change aligns with recommendations from the AspectJ maintainer, emphasizing the proper compilation of reusable AspectJ aspects.
Previously, Spring AOP ignored compiled AspectJ aspects. With the new update, Spring AOP no longer does so by default, leading to potential conflicts when certain configurations are used together.
With Spring auto-proxying active (enabled by default in Spring Boot), any @Aspect class exposed as a Spring bean will be considered for AOP proxying.
If an aspect is intended only for ajc compilation (e.g., using the AspectJ Maven plugin), ensure that:
Potential Conflicts:
Applications combining AspectJ weaving and @EnableAspectJAutoProxy while exposing AspectJ aspects as Spring-managed beans may encounter issues.
In Spring Boot, auto-proxying is enabled by default when AspectJ is on the classpath, even if weaving is used. This behavior can lead to unexpected conflicts.
Spring-Framework 6.1.7
As a workaround for this issue versions v6.1.15, v6.0.26 have the possibility to add as a system property or as a spring.properties file:
"spring.aop.ajc.ignore=true"