Xtend java source version configuration (maven) [message #1868121] |
Thu, 11 July 2024 11:26  |
Eclipse User |
|
|
|
Dear all,
I have Eclipse xtend plugins that have a lower Java compatibility level than the JRE/JDK used for compilation. In particular, I'd like to use OpenJDK21 for compilation, but the plugins are still at Java17.
The maven plugin configures the property javaSourceVersion to be lower which implies for instance that xtend extension need to be used for methods such as list.getLast().
However, if the xtend to Java generation is done with OpenJDK21, the javaSourceVersion configuration seems to be ignored, as for instance the method getLast is used in the generated Java code. Interestingly, setting JAVA_HOME to an older JRE implies that the maven org.eclipse.xtend modules produces the "right" code. But this is not a good solution for compilation on a CI server on which paths may change.
What is the method to configure the source code compatibility?
PS: Is it a bug that the javaSourceVersion attribute in class AbstractXtendCompilerMojo is defined by a property with a different name, see below?
@Parameter(property="maven.compiler.source", defaultValue="11")
private String javaSourceVersion;
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06573 seconds