After I read this post
http://gavingrover.blogspot.com/2007/09/weaving-into-groovy-with-aspectj.html
I was convinced that AspectJ and Groovy should play well together.
So I manage to get it working using maven-exec-plugin:
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>exec-maven-plugin</artifactId>
> <version>1.1</version>
> <executions>
> <execution>
> <phase>process-test-classes</phase>
> <goals>
> <goal>exec</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <executable>java</executable>
> <arguments>
> <argument>-classpath</argument>
> <classpath />
> <argument>org.aspectj.tools.ajc.Main</argument>
>
> <argument>${project.build.testSourceDirectory}/org/sonatype/nexus/plugins/groovytest/Hello.aj</argument>
> <argument>-inpath</argument>
> <argument>${project.build.testOutputDirectory}</argument>
> <argument>-1.5</argument>
> <argument>-d</argument>
> <argument>${project.build.testOutputDirectory}</argument>
> </arguments>
> </configuration>
> </plugin>
>
Hopefully this can help on aspectJ-maven-plugin fix.
VELO
On Fri, Feb 13, 2009 at 7:22 PM, Marvin Froeder <[email protected]> wrote:
> Hi Folks,
>
> I am using Groovy to run some integration tests. So far, everything was
> working well, but, I went into troubles when I try to add AspectJ on it.
>
> I attached my pom.
>
> I'm using gmaven and aspectJ only on tests phases. There are no sources on
> src/main/*
>
> When I only have gmaven, everything work:
>
>> <plugin>
>> <groupId>org.codehaus.groovy.maven</groupId>
>> <artifactId>gmaven-plugin</artifactId>
>> <version>1.0-rc-3</version>
>> <executions>
>> <execution>
>> <goals>
>> <goal>generateTestStubs</goal>
>> <goal>testCompile</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>>
>
> My tests run and I get results.
>
> But, when I enable AspectJ:
>
>> <plugin>
>> <groupId>org.codehaus.mojo</groupId>
>> <artifactId>aspectj-maven-plugin</artifactId>
>> <version>1.1</version>
>> <executions>
>> <execution>
>> <phase>process-test-classes</phase>
>> <goals>
>> <goal>test-compile</goal>
>> </goals>
>> </execution>
>> </executions>
>> <configuration>
>> <complianceLevel>1.5</complianceLevel>
>> </configuration>
>> </plugin>
>>
>
> I got the following warning:
>
>> [WARNING] build config error: skipping missing, empty or corrupt
>> aspectpath entry: D:\sonatype\workspace\groovy-test\target\classes
>>
>
> What worries me most is when this happens tests doesn't run anymore.
>
> Does anyone have any idea what is going on and how can I fix that?
>
>
> VELO
>