Reputation: 23
I have 2 projects. Project A - This is an aspectJ project. For example: It prints the method name and time taken, in console after execution of each method. Project B - It is a sample web project.
I want to add Project A as a Jar to Project B. So whenever I run Project B, it should display what are the method names and time taken.
Since I am new to AspectJ , could someone explain how to do this. Please explain with some sample projects. Thanks in advance.
Upvotes: 0
Views: 493
Reputation: 67297
You have several options:
-javaagent:/path/to/aspectjweaver.jar
command-line switch when starting your Java application containing B and put A on the classpath as an aspect library.For more information please use your favourite web search engine, specifying search terms like "aspectj ltw", "aspectj maven plugin", "aspectj ajc" or similar.
P.S.: Why should anyone provide one or multiple full sample projects if you are too lazy to provide a single line of code?
Upvotes: 1