Conversation
|
|
I did not look at it yet, we got this: Execution failed for task ':compileJava'.
|
|
@gtchaboussie : thanks for the contribution. I think you are also trying to increase the java source level - which might not be in scope right now. The important part is that OFBiz can be built using JDK-21. The build fails right now because the CI server uses only JDK-17. Regarding source level increase, looking at https://docs.oracle.com/en/java/javase/21/language/java-language-changes-summary.html , the only language changes that are new from 17->21 are:
Not sure if those are enough to warrant a source level increase. |
(OFBIZ-13306) Migration to Java 21 Thanks: Jacques for the warnings work and Nicolas. # Conflicts: # framework/base/src/test/java/org/apache/ofbiz/base/util/collections/FlexibleMapAccessorTests.java # framework/base/src/test/java/org/apache/ofbiz/base/util/string/FlexibleStringExpanderTests.java
(OFBIZ-13306) Migration to Java 21 Fix CheckStyle Thanks: Jacques for the warnings work and Nicolas.
eaf0dcd to
c476d4a
Compare
|
Hi @gtchaboussie, The Java build did not work. That's normal as "java-version: 17" is specified in gradle.yaml as mentioned @ieugen above. I did not dig further. |
(OFBIZ-13306) Update java version in github build
|
hi @JacquesLeRoux . |
|
Hi @gtchaboussie
The OFBIZ-13306 branch is in your fork, so you should be allowed to push new commit into it. |
|
Yeah sorry, i misread the error message friday. |
|
Hi Gaetan, I guess you can't push because of these premature commits I did I thought it was necessary to use Java 21. I will now revert them and see what happens here. As you may now (it's on dev ML), currently there are some issues with GHA (GH actions). That does not help when you mix different issues in an amalgam :( |
|
It was that, please try |
|
Thanks jacques. |
I think the answer is in Eugen Stan's comment apache#917 (comment)
|
|
The file used by the workflow still uses java 17: https://github.com/apache/ofbiz-framework/actions/runs/23431619247/workflow?pr=917 I don't know if there is a way to make it use the github file version from PR. |
|
There was another issue in the PR branch, harden runner was present. So now indeed gradle.yaml is the same than in trunk.
Maybe we need to use something like in gradle.build? |
|
This could help: https://www.baeldung.com/gradle-sourcecompatiblity-vs-targetcompatibility |
|
The CI/CD build fails because it uses JDK 17: (see https://github.com/apache/ofbiz-framework/blob/trunk/.github/workflows/gradle.yaml ) |
|
So what
I guess it's now time to try putting back what you @gtchaboussie initially put in gradle.yaml (ie using JDK 21) |
|
@JacquesLeRoux It means that the sources (at java 21) are not compatible with the runtime used by the workflow (java 17). |
|
Thanks @jacopoc, So it seems that the ball is in @gtchaboussie camp. I don't remember how we previously jumped from JDK 11 to 17, but Gaetan I guess what I did in build.gradle |
|
@JacquesLeRoux @gtchaboussie Before merging this, given that it’s an important step, I think we should ensure all concerns are addressed and approach it in a clean, deliberate way (rather than through incremental attempts). In particular, I think @ieugen’s earlier comment should be addressed. To summarize and expand on that point: ideally, we should define a clear compatibility strategy. One possible approach is to keep sourceCompatibility/targetCompatibility set to 17 for now, so that we continue producing Java 17–compatible bytecode, while running CI/CD on Java 21 to ensure the project works correctly on the newer runtime. However, if we want to truly guarantee compatibility with both versions, it might be worth considering running CI on both Java 17 and Java 21 (e.g., via a matrix build), rather than only on Java 21. More importantly, we should clarify whether this is meant to be a temporary transition phase or a longer-term strategy. In particular, if trunk starts adopting Java 21-specific features, backporting fixes to the release24.09 branch (which is still on Java 17) may become difficult or impossible. This is especially relevant given that our contribution workflow requires fixes to be committed to trunk first and then backported. Additionally, if we proceed with this PR, I think we should ensure that plugin upgrades are handled at the same time (I’m aware there is a separate PR for that), since Java version upgrades and plugin compatibility are often tightly coupled. Finally, we should also consider how to handle CI/CD, given that we currently have a single workflow shared between trunk and the release branch, but potentially different Java requirements. |
|
@jacopoc, should we not discuss on dev ML about that? |
@JacquesLeRoux yes, see the thread: "Move trunk to java 21" |
|
OK, I see Gaetan's message now |



Changed: Migration to Java 21
(OFBIZ-13306)
Migration to Java 21
Thanks: Jacques for the warnings work and Nicolas.