Spring AOP use AspectJ to works or what?

This might answer your question - it's an excerpt from mvn dependency:tree for a project that uses spring-aop:

[INFO] |  +- org.springframework:spring-aop:jar:3.2.3.RELEASE:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework:spring-aspects:jar:3.2.3.RELEASE:compile
[INFO] |  |  +- org.aspectj:aspectjweaver:jar:1.7.2:compile

As you can see, the Spring dependency transitively includes the AspectJ weaver.

That being said, the documentation states that

Spring 2.0 introduces a simpler and more powerful way of writing custom aspects using either a schema-based approach or the @AspectJ annotation style. Both of these styles offer fully typed advice and use of the AspectJ pointcut language, while still using Spring AOP for weaving.

Cheers,


At the very begining (until 1.2 version), Spring used to use AOP Alliance as the framework to provide AOP support. Then, Spring changed and started to use AspectJ for that.

The main difference between AspectJ and Spring AOP is that, firstly, Spring AOP provides a subset of features AspectJ provides and also, Spring AOP uses dynamic proxies as the strategy to implement it, while AspectJ enhances the bytecodes of a compiled class, with their specific compiler (you need to run a post-compile process to get your compiles classes ready to go).

In other words, Spring AOP uses AspectJ engine behind the scenes to provide AOP, what lets you use the power of that robust framework in a simpler way. But beware Spring AOP does not provide all AspectJ features

Take a look at this post for more info