I have a java module that depends on aspectj. When I use the module in a java project, I simply tell maven to use aspectj-maven-plugin (mojo) and compile the project with ajcCompiler. Steps are inhereted from Maven + AspectJ - all steps to configure it
Now I have a grails project and I need to use the module there. Therefore, as I understand it, I need to override the compiler to
ant.property(name:'build.compiler', value:'org.aspectj.tools.ant.taskdefs.Ajc11CompilerAdapter')
in _Events.groovy:eventCompileStart closure. this does not work, so there is also another suggestion to add an iajc task on eventCompileEnd (http://permalink.gmane.org/gmane.comp.lang.groovy.grails.user/127215)
How do I exactly do that? I am not sure about the process! BTW, I have 'org.codehaus.mojo:aspectj-maven-plugin:1.4' defined as compile time dependency on buildConfig.groovy
[update]
I defined this in _Events.groovy
ant.taskdef( resource:"org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties", classpath: configurations.ajc.asPath)
ant.iajc(destDir: grails.compile.classpath, source: "1.7", target:"1.7", ) {
classpathref(dir: classesDirPath)
}
This 'should' work, but ofcourse it does not! What am I missing?