Reputation: 8163
Follow-up of Is there a P2 repository with an up-to-date javassist?
The issue I have is related to Java lambdas. I am also using xtend, and xtend lambdas are generated as Java lambdas if source level compatibility is set to Java 8+, but as anonymous classes.
I know how to set the source compatibility level in Eclipse, but how do I configure it for xtend-maven-plugin? I did not find documentation.
Upvotes: 1
Views: 539
Reputation: 46
The 2.14.0 answer did not work for me. I had to use
<configuration>
<javaSourceVersion>1.8</javaSourceVersion>
</configuration>
in my pom file to force the xtend maven plugin to produce Java 8 code instead of the default, which is Java 1.6.
Upvotes: 2
Reputation: 8163
The property for this is maven.compiler.source
.
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
<version>2.14.0</version>
<configuration>
<maven.compiler.source>1.7</maven.compiler.source>
</configuration>
</plugin>
Maybe this can help someone in the future: Since this plugin has next to no documentation, I went to the Mojo source code and found:
/**
* Create Java Source Code that is compatible to this Java version.
*
* Supported values: 1.5, 1.6, 1.7, 1.8, 9 and 10
*/
@Parameter(property="maven.compiler.source", defaultValue="1.6")
private String javaSourceVersion;
Upvotes: 1