Hi!
Thank you for posting this description and code example!
This made me understand how to make our unittests run from inside eclipse when built by eclipse.
Until now the unittests worked just fine when running them from maven. When running them from eclipse we had to let maven do the compiling before running the tests if we had changed any of the classes using @Configurable to get dependencies injected
The next step was to make maven generate correct .project og .classpass file for us and we almost

do that now with the following in pom.xml:
Code:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<projectnatures>
<java.lang.String>org.springframework.ide.eclipse.core.springnature</java.lang.String>
<java.lang.String>org.eclipse.jdt.core.javanature</java.lang.String>
<java.lang.String>org.eclipse.ajdt.ui.ajnature</java.lang.String>
</projectnatures>
<buildcommands>
<buildcommand>org.eclipse.ajdt.core.ajbuilder</buildcommand>
</buildcommands>
</configuration>
</plugin>
What is missing here is generating the org.eclipse.ajdt.aspectpath attribute for the classpathentry in the .classpath file i.e.
Code:
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-aspects/2.0.6/spring-aspects-2.0.6.jar">
<attributes>
<attribute name="org.eclipse.ajdt.aspectpath" value="true"/>
</attributes>
</classpathentry>
This is not possible today with maven-eclipse-plugin, but there is an issue for this feature in the jira for maven-eclipse-plugin, see
http://jira.codehaus.org/browse/MECLIPSE-270
Feel free to vote for this issue!
btw are we using the following aspectj-maven-plugin configuration:
Code:
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>1.5</source>
<target>1.5</target>
<encoding>iso-8859-1</encoding>
<verbose>true</verbose>
<outxml>false</outxml>
<showWeaveInfo>true</showWeaveInfo>
<proceedOnError>true</proceedOnError>
<weaveDependencies>
<weaveDependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</weaveDependency>
</weaveDependencies>
<aspectLibrarys>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibrarys>
</configuration>
</plugin>
-Kaj
