Thanks for replying. I have since done additional testing/validation with Eclipse Luna but no additional success.
I'm running into a problematic issue with m2e and Eclipse (vs command line maven build). I am using a clean installation of Luna WTP 4.4.2 with m2e 1.5.1.
I have aspectj-maven-plugin configured in my pom.xml and the connector installed as well.
My plugin configuration specifies:
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sources>
<source>
<basedir>${project.build.sourceDirectory}</basedir>
</source>
</sources>
</configuration>
</execution>
<execution>
<id>test compile</id>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<sources>
<source>
<basedir>${project.build.testSourceDirectory}</basedir>
</source>
</sources>
<weaveDirectories>
<param>${project.build.outputDirectory}</param>
</weaveDirectories>
</configuration>
</execution>
</executions>
The goal is to have an aspect from my src/test/java path woven into my classes from src/main/java but output only in my target/test-classes. The reasoning behind this is that the aspect is only used for junit testing and not for normal code compilation/use.
When I build from the command line, everything works properly. The "compile" goal compiles & weaves all my src/main/java files to the target/classes output directory and the "test-compile" compiles & weaves all my src/test/java files into target/test-classes.
However, when I build from within Eclipse, my Aspects in src/test/java are woven into classes in target/classes as well (see target/classes/com/test/
ServiceImpl.class
. With the decompiler, I can see the MangleAspect has been woven in. Additionally, only the files from src/test/java are output into target/test-classes while the pom instructs ajc to do otherwise (weave all class files from target/classes into target/test-classes).
I've enabled debug from cmd line when I build (mvn -X) and I can see appropriate parameters passed to the aspectj-maven-plugin. However when I enable debug logging from .metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.${m2e.version}.xml, I do not see the parameters that are being passed to the aspectj-maven-plugin.
Does this have something to do with the lifecycle mapping connector? Is there a way to debug how that is working?
I uploaded my sample project to my github:
I did notice, however, if I disable the m2e connector and just use lifecycle mapping within my pom directly that instructs the aspectj plugin to execute on compile/test-compile goals, my output seems to be as I would expect. Can this be an m2e connector issue? I'm not entirely clear on how this connector works, or how it is injected into the m2e maven compile process.
Thanks,
Eric