I’m using Spring 3 and Maven. I’ve defined all spring modules in my pom.xml.
When I use <aop:scoped-proxy />, I get an error saying that CGLIB is missing.
Well… I add CGLIB as a dependency in my pom and it all runs…
I’m a little confused… Maven is a dependency manager… Why it does not download CGLIB when I use the spring-aop module?
It’s not the only case… Why do some projects need explicit dependency declaration instead of using Maven transitive dependency mechanism?
It’s because cglib is marked as an optional dependency.
Essentially you don’t need cglib for every usage of the spring-aop library, so maven doesn’t download it automatically. You need to specify it manually, unfortunately.