Using the aspectpath

The aspectpath enables aspects from a JAR file or an output directory to be weaved into a project and the results output to the normal location.

Using the aspectpath means that you can write your aspects in a different project and also means that they can be re-used across multiple projects. You may wish to build an aspect library, using the outjar setting or another method. Alternatively you can simply add the output directory of your aspect-containing project to the aspectpath.

To setup your AspectJ project to use the aspectpath:

  1. Select the AspectJ project in the Package Explorer
  2. Right click and select Properties
  3. Select AspectJ Aspect Path in the list on the left of the properties page
  4. Click the Libraries and Folders tab
  5. Add the necessary jar file or bin directory using the Add XXX buttons
  6. Click OK to close the project properties dialog

Related tasks
Launching a program with an aspectpath or an outjar
Using linked source folders
Using the inpath
Adding an outjar
Adding an aspectpath