Saturday, July 12, 2008

Problems with IntelliJ AspectJ plugin - SOLVED

I've looked into Oval Java Validation Framework, which seems quite nifty. The problem with it is that it doesn't work right out of the box if you want the extra bonus features, such as pre and post validation. For that you need AspectJ support, and for that... Well, lets just say your learning curve put on some weight.

This post is regarding solving an issue you may get when trying to use IntelliJ's AspectJ plugin. When running the test I've added here from IntelliJ, You get the message:

Error: ExactAnnotationTypePattern was written by a newer version of AspectJ

But, if I run Maven2 with "mvn clean install", and then run the test again in IntelliJ, everything is ok.


I've posted a message to the owner of the plugin, so I'll keep you informed on that progress. Until then, here's the sample code which should be a breeze to browse.

IntelliJ 7.0.3 build 7782
AspectJ weaver plugin v1.11
AspectJ 1.6.0

Update - issue solved

I contacted the maintainer of the IntelliJ AspectJWeaver plugin, Mattias Jiderhamn, and presented the issue.
I'm pleased to announce that the issue is now solved, and I can happily code aspectJ stuff from within IntelliJ. Hoorah!


  1. I am getting started with aspectj and am looking for a small functioning example that works in intellij.

    Any help would be appreciated.

  2. I used the oval-aspectj-maven-test from above. Just unzip, run "mvn test" to verify that it works and "mvn idea:idea -DdownloadSources" to set up the project. In addition, you have to set up the AspectJWeaver Plugin. I tested in IntelliJ 7.
    It might not be the simplest project to start with, but at least it's backed by Maven so you have verification on if you've set up the plugin correctly.
    I don't work with AspectJ on a regular basis, so any further recommendations are as good as googles, but projects using aspectj-maven-plugin have the brand of goodness as far as I care.

  3. Err, There's a V2.0 which I didn't notice. Can't remember the difference, but guess newer means better! :)


Spam will be pruned