I’d like to define aspectj joinpoints not using annotations and string constants like this:
@Before("execution(* my.class.getText(..))")
but using aspecj language, like in this example:
pointcut myMethod(): myClass() && execution(* *(..));
or
before (): getText() { Trace.traceEntry("" + thisJoinPointStaticPart.getSignature()); }
Is there any good examples of how to add aspectj to the project to make maven compile this language properly and how to re-write @Before, @Around etc. annotations in aspecj language?
Advertisement
Answer
Here are some resources:
- the AspectJ homepage including developer tutorials, also showing you how to use the AspectJ compiler (Ajc) from the command line,
- information about AspectJ Development Tools (AJDT) for Eclipse (but there is also an AspectJ integration into IntelliJ IDEA if you prefer that),
- a link to the AspectJ Maven Plugin which enables you to easily compile your Maven project including aspects.
Here on Stack Overflow, I have also answered many questions about how to configure AspectJ Maven Plugin, e.g. here.