I've written a maven module which uses AspectJ, and I'm compiling it with the AspectJ compiler plugin. I've written some unit tests which use Java 8 predicates, and when I run mvn clean install, the tests fail with this error:
error: lambda expressions are not supported in -source 1.5
Weirdly, when I include the standard compiler plugin as well as the aspectj compiler, it builds without issue. I'm reluctant to use both plugins since I believe they should be mutually exclusive?
compiler is setup as follows:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.8</version>
<configuration>
<complianceLevel>1.8</complianceLevel>
<source>1.8</source>
<target>1.8</target>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>