I want to use @cacheable annotations on objects that are not managed by spring. I am using the maven-aspectj compiler to complile the classes. But i dont see anything getting woven.
I dont have an @Aspect,as I am assuming spring should take care of this for all cache related annotations. I have the following in my config file.
I made couple of change after googling
<cache:annotation-driven mode="aspectj"/>
<context:annotation-config />
<context:component-scan base-package="com.merc.spring.cache.aspectj" />
added a aop.xml in META-INF folder with following in it
<aspectj>
<weaver options="-verbose -showWeaveInfo">
<include within="com.merc.spring.cache.aspectj..*"/>
</weaver>
</aspectj>
Just to validate if your @Cacheable classes are actually getting weaved with the CacheAspect, you can add this to the maven aspectj plugin:
EDIT
I am pasting my entire aspectj plugin configuration, this works for me in a project:
my java.version, aspectj.version is set to: