Post-compile weaving with AspectWerkz inside IntelliJ IDEA

Using the AspectWerkz plugin, IntelliJ will automatically weave the class files of compiled classes as part of the compilation process.


The plugin assumes AspectWerkz 2.0 and has been tested with IntelliJ IDEA 4.5.4 and 6.0


The plugin can easily be installed, or updated, through the plugin manager inside IntelliJ.
The plugin can also be downloaded from the menu above.


After installing, just activate the plugin for your project on the Build menu. The plugin will automatically find your aop.xml file in the same manner AspectWerkz does. Primarily it will look in ../aop.xml (as in WEB-INF) and secondarily in META-INF/aop.xml in your output path. If not found there, you could also put an file in your module content root (or in the same folder as the module file) and add an entry with aspectwerkz.definition.file pointing out the file.

The plugin will try to do the weaving inside the IntelliJ JVM (for speed and better logging ability). This may fail - for example if you are using Java 5 annotations - and then the plugin will revert to forking the module JVM transparently. It will also save a flag in the project settings, rememebering it needs to fork in the future.

Revision history

  • 1.0 - Making the plugin compatible with IntelliJ IDEA 5 and 6. Fixing incompatibility with some Windows path names.
    If you've had trouble using this plugin before, try again!


If you find any problems or feature requests, please contact me.
Please feel free to download the source code from the menu above.