Wednesday, January 13, 2010

Spring 3 and AspectJ

Moving to Spring 3 (and dropping the uber jar), my dependencies look a bit different. Eclipse started refusing to run tests: org/aspectj/lang/Signature not found, but only when running JUnit tests in Eclipse - Maven builds were fine.

After much searching, poking and prodding, I finally took the time to read the first line in the docs (http://maven.apache.org/plugins/maven-eclipse-plugin/examples/ajdt-projects.html): "The Eclipse plugin interacts with the Aspectj plugin to configure Eclipse to use AJDT." I had assumed, looking at their sample, it was present to configure specific things in AspectJ, and omitted the entire definition since I had no use for those configurations.

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
</plugin>

Adding this simple plugin to my made my classpath worries disappear. Woot, back to Spring 3 REST!