I'm reading spring documentation about AOP and now I'm at the section about using @AspectJ
style.
Spring AOP is implemented in pure Java. There is no need for a special compilation process. Spring AOP does not need to control the class loader hierarchy, and is thus suitable for use in a Servlet container or application server.
But in the section about @AspectJ
style said
The
@AspectJ
support can be enabled with XML or Java style configuration. In either case you will also need to ensure that AspectJ’saspectjweaver.jar
library is on the classpath of your application (version 1.6.8 or later).
As far as I know, aspectjweaver.jar
performs the actual weaving of aspects at compile-time or load time. But Spring has its own proxy-based implementation. So I really don't see any reason for aspectjweaver.jar
dependency.
That's true, to use @Aspect
annotation we need aspectjrt
dependency. But the dependency on weaver is not clear to me. Couldn't you explain in a nutshell how it actually works?