Using linked source folders
If you want to keep your aspects and your java code in separate
projects, then one setup you can use is linked source folders:
- Ensure your java project has a source folder (rather than
having it's source directly in the top level of the project)
- Create an AspectJ project which contains your aspects,
again ensuring that it has a source folder
- Within your AspectJ project, define a second source folder and
specify that it is a linked source folder. Either,
- Select the AspectJ project in the Package Explorer
- Select File > New > Folder
- Enter a name for your linked source folder
- Click Advanced
- Check link to folder in the file system and browse
to the location of the source folder in your non-AspectJ
project
- Click Finish
or
- Select the AspectJ project in the Package Explorer
- Right click and select Properties
- Select Java Build Path in the list on the left
of the properties page
- Click the Source tab
- Click Add Folder and then Create new Folder
- New Source Folder dialog will appear
- Enter a name for your linked source folder
- Click Advanced
- Check link to folder in the file system and browse
to the location of the source folder in your non-AspectJ
project
- Click OK to close the project properties dialog
When the AspectJ project is built, it will use the AspectJ project
source and the source from the non-AspectJ project and produce a
complete set of woven class files in the output directory of
the AspectJ project.
The advantage of using this approach is that the navigation and crosscutting
views available in AJDT will show how the advice in the aspects applies
to the java project.

Using the inpath
Using the aspectpath