mavenxtend

How to configure source compatbility level for xtend-maven-plugin?


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.


Solution

  • This is with xtend 2.20.

    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.