AspectJ LTW in eclipse - Pointcut does not work with static method

随声附和 提交于 2019-11-29 18:29:07

I just tried out your pointcut expression and it works on both static and non-static methods just as it should. I used AspectJ weaver 1.8.7. Try adding -showWeaveInfo and -verbose to your aop.xml for debug info on LTW.

<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
    <weaver options="-showWeaveInfo -verbose">
        <include within="q35218146..*" />
    </weaver>
    <aspects>
        <aspect name="q35218146.Aspect35218146"/>
    </aspects>
</aspectj>

It should give you output on stderr similar to this:

[AppClassLoader@14dad5dc] weaveinfo Join point 'method-execution(void q35218146.
Test35218146.executeTasks())' in Type 'q35218146.Test35218146' (Test35218146.java:6) 
advised by before advice from 'q35218146.Aspect35218146' (Aspect35218146.java)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!