Use maven.compiler.release instead of source plus target#3603
Use maven.compiler.release instead of source plus target#3603HannesWell wants to merge 2 commits intoeclipse-xtext:mainfrom
Conversation
The use of the --release option of the Java compiler implies a corresponding --source and --target value and is even more powerful: https://docs.oracle.com/en/java/javase/21/docs/specs/man/javac.html#option-release
79396bb to
fb0fb67
Compare
|
can you import the reference projects onto xtext dev workspace and execute the launch config to regenerate them. |
Done in |
How to admit that I my gradle knowledge is almost zero (tried to use/configure it once and failed miserably). |
|
how does your schedule next week tuesday at 9am look like? |
According to Gemini AI one can just set Should I apply this too?
I could be available. |
|
https://github.com/eclipse-xtext/xtext/actions/runs/22051341768/job/63710002939?pr=3603 |
|
@szarnekow can you add hannes to the meeting |
Java-17 is the Java baseline at the moment.
Since it consistently failed over all build I think it is related. The output was It might be related to the fact that the default source/target version of the xtext/xtend compiler mojo were still at Java-11. |
|
yes but i dont remember what @LorenzoBettini did back then when looking into the record topic |
|
As I said in #3601 (comment), we need .source and .target because Xtend reads them, but not .release, is that right @szarnekow ? |
|
there is org.eclipse.xtend.maven.AbstractXtendCompilerMojo.javaSourceVersion that i could find |
Indeed, yes that makes sense and explains the error. Thanks! Before this change the mojos read the source/target values from the corresponding properties and now fall back to their default, which is/was Java-11, which doesn't know records. But I wonder if there is a specific reason to not read Then changing the default of source/target/release could be applied in a follow-up (if you want that at all). |
Probably updating the maven plugins to also read that property would be the right way to go. |
Great. I already took action and we can discuss details at Since this effectively depends on the latter and it seems Xtext doesn't use SNAPSHOTs of its own Maven plugins it would be good of that could land in the upcoming release |
The use of the
--releaseoption of the Java compiler implies a corresponding--sourceand--targetvalue and is even more powerful: https://docs.oracle.com/en/java/javase/21/docs/specs/man/javac.html#option-release