[ 
https://issues.apache.org/jira/browse/CAMEL-22996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aurélien Pupier updated CAMEL-22996:
------------------------------------
    Description: 
As part of the big work leading up to SB4 and what else, then its worth to 
consider dropping Java 17 and let 21 be primary supported and also the minimum 
version.

There is no bandwidth to support 17, 21, and 25. Camel only officially support 
at most 2 LTS java versions.

To reopen when upgraded https://github.com/apache/camel/pull/24299

h2. Plan: Drop Java 17 — Make Java 21 the Minimum Version

The build already requires JDK 21+ (enforcer rule in root pom.xml), so this is 
a compile-target + runtime change. Six areas need updating.

h3. Sub-Task 1 — Raise jdk.version in the root POM

Changing the single jdk.version property propagates maven.compiler.source, 
maven.compiler.target, maven.compiler.release, minimalJavaBuildVersion, and 
sonar.java.source to every module.

In pom.xml line 113, change <jdk.version>17</jdk.version> → 
<jdk.version>21</jdk.version>
Note: the enforcer requireJavaVersion already says [21,) — no change needed 
there.

h3. Sub-Task 2 — Update archetype template POMs

Archetypes still hard-code <release>17</release> and would generate Java-17 
user projects.

archetypes/camel-archetype-main/src/main/resources/archetype-resources/pom.xml 
— change 17 → 21
archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml 
— change 17 → 21
archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/pom.xml
 — change 17 → 21
archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml
 — change 17 → 21
archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml
 — change 17 → 21
archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/pom.xml
 — change 17 → 21
h3. Sub-Task 3 — Remove Java 17 from GitHub Actions CI matrix

The PR build matrix tests ['17', '25'], keeping JDK 17 "for runtime 
compatibility testing". Once 21 is the minimum that row is redundant.

File: .github/workflows/pr-build-main.yml

Remove '17' from the java: matrix list
Remove the include: block that injects -Denforcer.phase=none for Java 17
Add '21' to the matrix so the new minimum is covered (result: ['21', '25'])
Note: .github/workflows/main-build.yml builds only with Java 25 — no change 
needed.

h3. Sub-Task 4 — Remove Java 17 from the Jenkins pipeline

File: Jenkinsfile

Remove def MAVEN_JDK_17_PARAMS = "-Denforcer.skip=true" (line 20)
Remove 'jdk_17_latest' from the JDK_FILTER parameter choices (line 55)
Remove 'jdk_17_latest' from the JDK_NAME axis values (line 80)
Remove the two exclude blocks that pair jdk_17_latest with ppc64le and s390x 
(lines 88–107)
Remove the else if ("${JDK_NAME}" == "jdk_17_latest") build branch (lines 
168–170)
h3. Sub-Task 5 — Resolve "TODO Update once baseline is Java 21" code comments

11 locations deferred API modernisation behind that comment. The changes are:

Replace Thread.getId() with Thread.threadId() (deprecated since Java 19):

core/camel-management/.../ManagedAsyncProcessorAwaitManager.java line 85
core/camel-base-engine/.../DefaultAsyncProcessorAwaitManager.java line 262
components/camel-google/camel-google-pubsub/.../GooglePubsubProducer.java line 
65
components/camel-google/camel-google-bigquery/.../GoogleBigQueryProducer.java 
line 175
components/camel-as2/.../AS2ServerConnection.java line 493
components/camel-as2/.../AS2AsyncMDNServerConnection.java line 198
components/camel-smpp/.../SmppProducer.java lines 96, 175, 226
components/camel-smpp/.../SmppConsumer.java line 201
Replace new Locale(...) constructor with Locale.of(...) factory method 
(available since Java 19):

components/camel-bindy/.../FormattingOptions.java line 126

h3. Sub-Task 6 — Promote Java-21 CamelThreadFactory to the main source tree

Currently core/camel-util ships a multi-release JAR: the fallback in 
src/main/java is a platform-threads-only stub (isVirtual() always returns 
false, newThread() uses new Thread(...)), and the real implementation 
supporting both platform and virtual threads lives in src/main/java21. Once 
Java 21 is the baseline there is no need for the fallback — the java21 version 
should become the canonical implementation.

Copy src/main/java21/.../CamelThreadFactory.java over 
src/main/java/.../CamelThreadFactory.java
Remove src/main/java21/.../CamelThreadFactory.java
Remove the java-21-sources Maven profile from core/camel-util/pom.xml (the 
separate compile execution and the Multi-Release: true manifest entry it sets), 
since the single source tree now compiles everything at the Java 21 release 
level
Update the Javadoc on the class to remove the "On JDK 17, only platform threads 
are available" note
Note: the java-25-sources profile for ContextValueFactory is independent and 
must be kept7


h3. Sub-Task 7 — Update user-facing documentation

Historical upgrade guides that mention Java 17 in the context of past releases 
must not be changed — only forward-looking pages.

docs/user-manual/modules/ROOT/pages/what-are-the-dependencies.adoc — add a new 
JDK support row: Camel 4.24.0+ requires JDK 21
docs/user-manual/modules/ROOT/pages/camel-jbang-getting-started.adoc line 7 — 
replace "Java 17 or later" with "Java 21 or later"
docs/user-manual/modules/ROOT/pages/camel-jbang-launcher-install.adoc lines 25 
& 47 — replace "Java 17+" with "Java 21+"
Create/update 
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc — add a 
"Java" section noting the new minimum requirement
Add the xref link for 4.24 in 
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide.adoc if not already 
present
h3. Out of scope

Enabling virtual threads by default (separate decision)
Promoting the Java-21 multi-release CamelThreadFactory to the main source tree 
(the multi-release JAR already picks it up at runtime; can be a follow-up)
Any Java 25-specific work

h2. Dependency Diagram

```
Sub-Task 1 (root POM jdk.version)
    └─ Sub-Task 2 (archetype POMs)        [independent, can run in parallel]
    └─ Sub-Task 3 (GitHub Actions)        [independent]
    └─ Sub-Task 4 (Jenkinsfile)           [independent]
    └─ Sub-Task 5 (TODO modernisations)   [independent]
    └─ Sub-Task 6 (CamelThreadFactory)   [independent]
    └─ Sub-Task 7 (documentation)         [independent]
```

All sub-tasks are logically independent once Sub-Task 1 establishes the intent, 
but they can be
committed separately or together. I think there should be separated commit for 
each-subtask but provided in a single PR


  was:
As part of the big work leading up to SB4 and what else, then its worth to 
consider dropping Java 17 and let 21 be primary supported and also the minimum 
version.

There is no bandwidth to support 17, 21, and 25. Camel only officially support 
at most 2 LTS java versions.

To reopen when upgraded https://github.com/apache/camel/pull/24299

h2. Plan: Drop Java 17 — Make Java 21 the Minimum Version

The build already requires JDK 21+ (enforcer rule in root pom.xml), so this is 
a compile-target + runtime change. Six areas need updating.

h3. Sub-Task 1 — Raise jdk.version in the root POM

Changing the single jdk.version property propagates maven.compiler.source, 
maven.compiler.target, maven.compiler.release, minimalJavaBuildVersion, and 
sonar.java.source to every module.

In pom.xml line 113, change <jdk.version>17</jdk.version> → 
<jdk.version>21</jdk.version>
Note: the enforcer requireJavaVersion already says [21,) — no change needed 
there.

h3. Sub-Task 2 — Update archetype template POMs

Archetypes still hard-code <release>17</release> and would generate Java-17 
user projects.

archetypes/camel-archetype-main/src/main/resources/archetype-resources/pom.xml 
— change 17 → 21
archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml 
— change 17 → 21
archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/pom.xml
 — change 17 → 21
archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml
 — change 17 → 21
archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml
 — change 17 → 21
archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/pom.xml
 — change 17 → 21
h3. Sub-Task 3 — Remove Java 17 from GitHub Actions CI matrix

The PR build matrix tests ['17', '25'], keeping JDK 17 "for runtime 
compatibility testing". Once 21 is the minimum that row is redundant.

File: .github/workflows/pr-build-main.yml

Remove '17' from the java: matrix list
Remove the include: block that injects -Denforcer.phase=none for Java 17
Add '21' to the matrix so the new minimum is covered (result: ['21', '25'])
Note: .github/workflows/main-build.yml builds only with Java 25 — no change 
needed.

h3. Sub-Task 4 — Remove Java 17 from the Jenkins pipeline

File: Jenkinsfile

Remove def MAVEN_JDK_17_PARAMS = "-Denforcer.skip=true" (line 20)
Remove 'jdk_17_latest' from the JDK_FILTER parameter choices (line 55)
Remove 'jdk_17_latest' from the JDK_NAME axis values (line 80)
Remove the two exclude blocks that pair jdk_17_latest with ppc64le and s390x 
(lines 88–107)
Remove the else if ("${JDK_NAME}" == "jdk_17_latest") build branch (lines 
168–170)
h3. Sub-Task 5 — Resolve "TODO Update once baseline is Java 21" code comments

11 locations deferred API modernisation behind that comment. The changes are:

Replace Thread.getId() with Thread.threadId() (deprecated since Java 19):

core/camel-management/.../ManagedAsyncProcessorAwaitManager.java line 85
core/camel-base-engine/.../DefaultAsyncProcessorAwaitManager.java line 262
components/camel-google/camel-google-pubsub/.../GooglePubsubProducer.java line 
65
components/camel-google/camel-google-bigquery/.../GoogleBigQueryProducer.java 
line 175
components/camel-as2/.../AS2ServerConnection.java line 493
components/camel-as2/.../AS2AsyncMDNServerConnection.java line 198
components/camel-smpp/.../SmppProducer.java lines 96, 175, 226
components/camel-smpp/.../SmppConsumer.java line 201
Replace new Locale(...) constructor with Locale.of(...) factory method 
(available since Java 19):

components/camel-bindy/.../FormattingOptions.java line 126
h3. Sub-Task 6 — Update user-facing documentation

Historical upgrade guides that mention Java 17 in the context of past releases 
must not be changed — only forward-looking pages.

docs/user-manual/modules/ROOT/pages/what-are-the-dependencies.adoc — add a new 
JDK support row: Camel 4.24.0+ requires JDK 21
docs/user-manual/modules/ROOT/pages/camel-jbang-getting-started.adoc line 7 — 
replace "Java 17 or later" with "Java 21 or later"
docs/user-manual/modules/ROOT/pages/camel-jbang-launcher-install.adoc lines 25 
& 47 — replace "Java 17+" with "Java 21+"
Create/update 
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc — add a 
"Java" section noting the new minimum requirement
Add the xref link for 4.24 in 
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide.adoc if not already 
present
h3. Out of scope

Enabling virtual threads by default (separate decision)
Promoting the Java-21 multi-release CamelThreadFactory to the main source tree 
(the multi-release JAR already picks it up at runtime; can be a follow-up)
Any Java 25-specific work

h2. Dependency Diagram

```
Sub-Task 1 (root POM jdk.version)
    └─ Sub-Task 2 (archetype POMs)        [independent, can run in parallel]
    └─ Sub-Task 3 (GitHub Actions)        [independent]
    └─ Sub-Task 4 (Jenkinsfile)           [independent]
    └─ Sub-Task 5 (TODO modernisations)   [independent]
    └─ Sub-Task 6 (documentation)         [independent]
```

All sub-tasks are logically independent once Sub-Task 1 establishes the intent, 
but they can be
committed separately or together. I think there should be separated commit for 
each-subtask but provided in a single PR



> Drop Java 17 so Java 21 is minimum and primary supported
> --------------------------------------------------------
>
>                 Key: CAMEL-22996
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22996
>             Project: Camel
>          Issue Type: Task
>          Components: build system
>            Reporter: Claus Ibsen
>            Assignee: Aurélien Pupier
>            Priority: Major
>             Fix For: 4.24.0
>
>
> As part of the big work leading up to SB4 and what else, then its worth to 
> consider dropping Java 17 and let 21 be primary supported and also the 
> minimum version.
> There is no bandwidth to support 17, 21, and 25. Camel only officially 
> support at most 2 LTS java versions.
> To reopen when upgraded https://github.com/apache/camel/pull/24299
> h2. Plan: Drop Java 17 — Make Java 21 the Minimum Version
> The build already requires JDK 21+ (enforcer rule in root pom.xml), so this 
> is a compile-target + runtime change. Six areas need updating.
> h3. Sub-Task 1 — Raise jdk.version in the root POM
> Changing the single jdk.version property propagates maven.compiler.source, 
> maven.compiler.target, maven.compiler.release, minimalJavaBuildVersion, and 
> sonar.java.source to every module.
> In pom.xml line 113, change <jdk.version>17</jdk.version> → 
> <jdk.version>21</jdk.version>
> Note: the enforcer requireJavaVersion already says [21,) — no change needed 
> there.
> h3. Sub-Task 2 — Update archetype template POMs
> Archetypes still hard-code <release>17</release> and would generate Java-17 
> user projects.
> archetypes/camel-archetype-main/src/main/resources/archetype-resources/pom.xml
>  — change 17 → 21
> archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml
>  — change 17 → 21
> archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/pom.xml
>  — change 17 → 21
> archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml
>  — change 17 → 21
> archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml
>  — change 17 → 21
> archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/pom.xml
>  — change 17 → 21
> h3. Sub-Task 3 — Remove Java 17 from GitHub Actions CI matrix
> The PR build matrix tests ['17', '25'], keeping JDK 17 "for runtime 
> compatibility testing". Once 21 is the minimum that row is redundant.
> File: .github/workflows/pr-build-main.yml
> Remove '17' from the java: matrix list
> Remove the include: block that injects -Denforcer.phase=none for Java 17
> Add '21' to the matrix so the new minimum is covered (result: ['21', '25'])
> Note: .github/workflows/main-build.yml builds only with Java 25 — no change 
> needed.
> h3. Sub-Task 4 — Remove Java 17 from the Jenkins pipeline
> File: Jenkinsfile
> Remove def MAVEN_JDK_17_PARAMS = "-Denforcer.skip=true" (line 20)
> Remove 'jdk_17_latest' from the JDK_FILTER parameter choices (line 55)
> Remove 'jdk_17_latest' from the JDK_NAME axis values (line 80)
> Remove the two exclude blocks that pair jdk_17_latest with ppc64le and s390x 
> (lines 88–107)
> Remove the else if ("${JDK_NAME}" == "jdk_17_latest") build branch (lines 
> 168–170)
> h3. Sub-Task 5 — Resolve "TODO Update once baseline is Java 21" code comments
> 11 locations deferred API modernisation behind that comment. The changes are:
> Replace Thread.getId() with Thread.threadId() (deprecated since Java 19):
> core/camel-management/.../ManagedAsyncProcessorAwaitManager.java line 85
> core/camel-base-engine/.../DefaultAsyncProcessorAwaitManager.java line 262
> components/camel-google/camel-google-pubsub/.../GooglePubsubProducer.java 
> line 65
> components/camel-google/camel-google-bigquery/.../GoogleBigQueryProducer.java 
> line 175
> components/camel-as2/.../AS2ServerConnection.java line 493
> components/camel-as2/.../AS2AsyncMDNServerConnection.java line 198
> components/camel-smpp/.../SmppProducer.java lines 96, 175, 226
> components/camel-smpp/.../SmppConsumer.java line 201
> Replace new Locale(...) constructor with Locale.of(...) factory method 
> (available since Java 19):
> components/camel-bindy/.../FormattingOptions.java line 126
> h3. Sub-Task 6 — Promote Java-21 CamelThreadFactory to the main source tree
> Currently core/camel-util ships a multi-release JAR: the fallback in 
> src/main/java is a platform-threads-only stub (isVirtual() always returns 
> false, newThread() uses new Thread(...)), and the real implementation 
> supporting both platform and virtual threads lives in src/main/java21. Once 
> Java 21 is the baseline there is no need for the fallback — the java21 
> version should become the canonical implementation.
> Copy src/main/java21/.../CamelThreadFactory.java over 
> src/main/java/.../CamelThreadFactory.java
> Remove src/main/java21/.../CamelThreadFactory.java
> Remove the java-21-sources Maven profile from core/camel-util/pom.xml (the 
> separate compile execution and the Multi-Release: true manifest entry it 
> sets), since the single source tree now compiles everything at the Java 21 
> release level
> Update the Javadoc on the class to remove the "On JDK 17, only platform 
> threads are available" note
> Note: the java-25-sources profile for ContextValueFactory is independent and 
> must be kept7
> h3. Sub-Task 7 — Update user-facing documentation
> Historical upgrade guides that mention Java 17 in the context of past 
> releases must not be changed — only forward-looking pages.
> docs/user-manual/modules/ROOT/pages/what-are-the-dependencies.adoc — add a 
> new JDK support row: Camel 4.24.0+ requires JDK 21
> docs/user-manual/modules/ROOT/pages/camel-jbang-getting-started.adoc line 7 — 
> replace "Java 17 or later" with "Java 21 or later"
> docs/user-manual/modules/ROOT/pages/camel-jbang-launcher-install.adoc lines 
> 25 & 47 — replace "Java 17+" with "Java 21+"
> Create/update 
> docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc — add a 
> "Java" section noting the new minimum requirement
> Add the xref link for 4.24 in 
> docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide.adoc if not 
> already present
> h3. Out of scope
> Enabling virtual threads by default (separate decision)
> Promoting the Java-21 multi-release CamelThreadFactory to the main source 
> tree (the multi-release JAR already picks it up at runtime; can be a 
> follow-up)
> Any Java 25-specific work
> h2. Dependency Diagram
> ```
> Sub-Task 1 (root POM jdk.version)
>     └─ Sub-Task 2 (archetype POMs)        [independent, can run in parallel]
>     └─ Sub-Task 3 (GitHub Actions)        [independent]
>     └─ Sub-Task 4 (Jenkinsfile)           [independent]
>     └─ Sub-Task 5 (TODO modernisations)   [independent]
>     └─ Sub-Task 6 (CamelThreadFactory)   [independent]
>     └─ Sub-Task 7 (documentation)         [independent]
> ```
> All sub-tasks are logically independent once Sub-Task 1 establishes the 
> intent, but they can be
> committed separately or together. I think there should be separated commit 
> for each-subtask but provided in a single PR



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to