aspectj: How to weave aspects from a library into user code?

a 夏天 提交于 2019-12-10 11:57:09

问题


I have a library with some classes and a few aspects in it. Say AspectedLib.jar is the file that contains such definitions (created in eclipse, with "export jar file with aspectj support"). If I import the AspectedLib.jar file, and even use some of the classes defined in it, it works, but none of the joinpoints is triggered, i.e., the aspects are not executed.

How can I make this work? Ideally, how can I set this up in eclipse*?

* Version: Juno Service Release 2; Build id: 20130225-0426


回答1:


You need to add the jar to your aspect path. In your Eclipse project preferences, go to AspectJ build -> Aspect Path and add the jar.



来源:https://stackoverflow.com/questions/15883871/aspectj-how-to-weave-aspects-from-a-library-into-user-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!