This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new 40616f35c02 CAMEL-23112 - Drop JDK 17 Support (#1697)
40616f35c02 is described below
commit 40616f35c022d76a692e2d312a0a9b54f7985e0f
Author: Andrea Cosentino <[email protected]>
AuthorDate: Wed Mar 4 14:13:16 2026 +0100
CAMEL-23112 - Drop JDK 17 Support (#1697)
Signed-off-by: Andrea Cosentino <[email protected]>
---
.github/workflows/automatic-sync-main.yml | 2 +-
.github/workflows/generate-sbom-main.yml | 2 +-
.github/workflows/pr-build-main.yml | 2 +-
.../src/main/resources/archetype-resources/pom.xml | 2 +-
...ingBootPlatformHttpCamelVirtualThreadsTest.java | 3 --
...ormHttpMultipleExecutorsVirtualThreadsTest.java | 3 --
...ootPlatformHttpVirtualThreadsOptimizedTest.java | 3 --
.../SpringBootPlatformHttpVirtualThreadsTest.java | 3 --
core/camel-spring-boot/pom.xml | 57 +++++-----------------
...CamelVirtualThreadEnvironmentPostProcessor.java | 16 ++----
.../camel/spring/boot/CamelVirtualThreadsTest.java | 0
pom.xml | 7 ++-
12 files changed, 21 insertions(+), 79 deletions(-)
diff --git a/.github/workflows/automatic-sync-main.yml
b/.github/workflows/automatic-sync-main.yml
index 595e3e04c68..abad8d1ca7b 100644
--- a/.github/workflows/automatic-sync-main.yml
+++ b/.github/workflows/automatic-sync-main.yml
@@ -38,7 +38,7 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 17
+ java-version: 21
cache: 'maven'
- name: Build Camel Project
run: ./mvnw -V --no-transfer-progress -Dquickly clean install
diff --git a/.github/workflows/generate-sbom-main.yml
b/.github/workflows/generate-sbom-main.yml
index de553ee6302..dfdc779336c 100644
--- a/.github/workflows/generate-sbom-main.yml
+++ b/.github/workflows/generate-sbom-main.yml
@@ -40,7 +40,7 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 17
+ java-version: 21
cache: 'maven'
- name: Build Camel Project
run: ./mvnw -B -V --no-transfer-progress -Dquickly install
diff --git a/.github/workflows/pr-build-main.yml
b/.github/workflows/pr-build-main.yml
index 73db087b5b9..d3af89aabc5 100644
--- a/.github/workflows/pr-build-main.yml
+++ b/.github/workflows/pr-build-main.yml
@@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- java: ['17']
+ java: ['21']
steps:
- uses: actions/checkout@v6
with:
diff --git
a/archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/pom.xml
b/archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/pom.xml
index 173de86ddf0..31988712cdd 100644
---
a/archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/pom.xml
+++
b/archetypes/camel-archetype-spring-boot/src/main/resources/archetype-resources/pom.xml
@@ -97,7 +97,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin-version}</version>
<configuration>
- <release>11</release>
+ <release>21</release>
</configuration>
</plugin>
<plugin>
diff --git
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelVirtualThreadsTest.java
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelVirtualThreadsTest.java
index 039271d09f6..44835a2fc0f 100644
---
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelVirtualThreadsTest.java
+++
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpCamelVirtualThreadsTest.java
@@ -20,8 +20,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
import org.apache.camel.test.spring.junit6.CamelSpringBootTest;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledOnJre;
-import org.junit.jupiter.api.condition.JRE;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
@@ -37,7 +35,6 @@ import static org.assertj.core.api.Assertions.assertThat;
SpringBootPlatformHttpCamelVirtualThreadsTest.class,
SpringBootPlatformHttpCamelVirtualThreadsTest.TestConfiguration.class,
PlatformHttpComponentAutoConfiguration.class,
SpringBootPlatformHttpAutoConfiguration.class },
properties = "spring.threads.virtual.enabled=true")
-@DisabledOnJre({JRE.JAVA_17, JRE.JAVA_18, JRE.JAVA_19, JRE.JAVA_20})
public class SpringBootPlatformHttpCamelVirtualThreadsTest extends
PlatformHttpBase {
private static final String postRouteId =
"SpringBootPlatformHttpCamelVirtualThreadsTest_mypost";
diff --git
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.java
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.java
index 2b2b130c595..8c6f345aa1b 100644
---
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.java
+++
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest.java
@@ -21,8 +21,6 @@ import org.apache.camel.spring.boot.CamelAutoConfiguration;
import org.apache.camel.test.spring.junit6.CamelSpringBootTest;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledOnJre;
-import org.junit.jupiter.api.condition.JRE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity;
@@ -48,7 +46,6 @@ import java.util.concurrent.Executor;
PlatformHttpComponentAutoConfiguration.class,
SpringBootPlatformHttpAutoConfiguration.class },
properties = "spring.threads.virtual.enabled=true")
@EnableScheduling
-@DisabledOnJre({JRE.JAVA_17, JRE.JAVA_18, JRE.JAVA_19, JRE.JAVA_20})
@AutoConfigureRestTestClient
public class SpringBootPlatformHttpMultipleExecutorsVirtualThreadsTest extends
PlatformHttpBase {
diff --git
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsOptimizedTest.java
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsOptimizedTest.java
index cdab352d373..ce3f3f09399 100644
---
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsOptimizedTest.java
+++
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsOptimizedTest.java
@@ -20,8 +20,6 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
import org.apache.camel.test.spring.junit6.CamelSpringBootTest;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledOnJre;
-import org.junit.jupiter.api.condition.JRE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
@@ -42,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat;
SpringBootPlatformHttpVirtualThreadsOptimizedTest.class,
SpringBootPlatformHttpVirtualThreadsOptimizedTest.TestConfiguration.class,
PlatformHttpComponentAutoConfiguration.class,
SpringBootPlatformHttpAutoConfiguration.class },
properties = "spring.threads.virtual.enabled=true")
-@DisabledOnJre({JRE.JAVA_17, JRE.JAVA_18, JRE.JAVA_19, JRE.JAVA_20})
public class SpringBootPlatformHttpVirtualThreadsOptimizedTest extends
PlatformHttpBase {
private static final String postRouteId =
"SpringBootPlatformHttpVirtualThreadsOptimizedTest_mypost";
diff --git
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsTest.java
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsTest.java
index c60a131c039..ca4d64af0e2 100644
---
a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsTest.java
+++
b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpVirtualThreadsTest.java
@@ -19,8 +19,6 @@ package org.apache.camel.component.platform.http.springboot;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
import org.apache.camel.test.spring.junit6.CamelSpringBootTest;
-import org.junit.jupiter.api.condition.DisabledOnJre;
-import org.junit.jupiter.api.condition.JRE;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
@@ -34,7 +32,6 @@ import org.springframework.security.web.SecurityFilterChain;
SpringBootPlatformHttpVirtualThreadsTest.class,
SpringBootPlatformHttpVirtualThreadsTest.TestConfiguration.class,
PlatformHttpComponentAutoConfiguration.class,
SpringBootPlatformHttpAutoConfiguration.class },
properties = "spring.threads.virtual.enabled=true")
-@DisabledOnJre({JRE.JAVA_17, JRE.JAVA_18, JRE.JAVA_19, JRE.JAVA_20})
public class SpringBootPlatformHttpVirtualThreadsTest extends PlatformHttpBase
{
private static final String postRouteId =
"SpringBootPlatformHttpTest_mypost";
diff --git a/core/camel-spring-boot/pom.xml b/core/camel-spring-boot/pom.xml
index 6385444cc58..09d6a8cc636 100644
--- a/core/camel-spring-boot/pom.xml
+++ b/core/camel-spring-boot/pom.xml
@@ -269,53 +269,18 @@
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-surefire-plugin-version}</version>
+ <configuration>
+ <systemPropertyVariables>
+
<spring.threads.virtual.enabled>true</spring.threads.virtual.enabled>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
</plugins>
</build>
- <profiles>
- <!-- Profile for JDK 21+ features like Virtual Threads -->
- <profile>
- <id>jdk21</id>
- <activation>
- <jdk>[21,)</jdk>
- </activation>
- <build>
- <plugins>
- <!-- Configure compiler for JDK 21 compatibility in this
profile -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${maven-compiler-plugin-version}</version>
- <executions>
- <execution>
- <id>testCompile-java-21</id>
- <phase>test-compile</phase>
- <goals>
- <goal>testCompile</goal>
- </goals>
- <configuration>
- <release>21</release>
-
<compileSourceRoots>${project.basedir}/src/test/java21</compileSourceRoots>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Configure surefire to run JDK 21 specific tests -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${maven-surefire-plugin-version}</version>
- <configuration>
- <!-- Enable Spring virtual threads - the
CamelVirtualThreadEnvironmentPostProcessor
- will automatically set
camel.threads.virtual.enabled=true -->
- <systemPropertyVariables>
-
<spring.threads.virtual.enabled>true</spring.threads.virtual.enabled>
- </systemPropertyVariables>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelVirtualThreadEnvironmentPostProcessor.java
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelVirtualThreadEnvironmentPostProcessor.java
index 453583963ee..b6c79459218 100644
---
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelVirtualThreadEnvironmentPostProcessor.java
+++
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelVirtualThreadEnvironmentPostProcessor.java
@@ -23,33 +23,23 @@ import
org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.env.ConfigurableEnvironment;
/**
- * Environment post processor that automatically sets the Camel virtual thread
+ * Environment post processor that automatically sets the Camel virtual thread
* system property when Spring Boot virtual threads are enabled.
- *
+ *
* This processor runs very early in the Spring Boot startup process, before
- * any Camel classes are loaded, ensuring that Camel's ThreadType static
+ * any Camel classes are loaded, ensuring that Camel's ThreadType static
* initialization picks up the correct virtual thread configuration.
*/
public class CamelVirtualThreadEnvironmentPostProcessor implements
EnvironmentPostProcessor {
private static final Logger LOG =
LoggerFactory.getLogger(CamelVirtualThreadEnvironmentPostProcessor.class);
- private static final int VIRTUAL_THREADS_MIN_JAVA_VERSION = 21;
-
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment,
SpringApplication application) {
// Check if Spring Boot virtual threads are enabled
String springVirtualThreads =
environment.getProperty("spring.threads.virtual.enabled");
if ("true".equalsIgnoreCase(springVirtualThreads)) {
- // Verify we're running on JDK 21+ where virtual threads are
available
- int javaVersion = Runtime.version().feature();
- if (javaVersion < VIRTUAL_THREADS_MIN_JAVA_VERSION) {
- LOG.debug("spring.threads.virtual.enabled=true but running on
JDK {} (virtual threads require JDK 21+)",
- javaVersion);
- return;
- }
-
// Set the Camel virtual threads system property early, before
Camel classes are loaded
String existingCamelProperty =
System.getProperty("camel.threads.virtual.enabled");
diff --git
a/core/camel-spring-boot/src/test/java21/org/apache/camel/spring/boot/CamelVirtualThreadsTest.java
b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelVirtualThreadsTest.java
similarity index 100%
rename from
core/camel-spring-boot/src/test/java21/org/apache/camel/spring/boot/CamelVirtualThreadsTest.java
rename to
core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelVirtualThreadsTest.java
diff --git a/pom.xml b/pom.xml
index b3e88d2a43e..2b1660984ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,7 +104,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<site-repo-url>scpexe://people.apache.org/www/camel.apache.org/maven/</site-repo-url>
- <jdk.version>17</jdk.version>
+ <jdk.version>21</jdk.version>
<!-- These two are here only to prevent the versions for the Apache
parent pom from leaking-->
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
@@ -178,9 +178,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
- <source>17</source>
+ <source>21</source>
<additionalOptions>${javadoc.opts}</additionalOptions>
- <!-- disable Javadoc linting for buildung the release with
Java 11 -->
<doclint>none</doclint>
</configuration>
</plugin>
@@ -677,7 +676,7 @@
<goal>jar</goal>
</goals>
<configuration>
- <source>17</source>
+ <source>21</source>
<doclint>none</doclint>
</configuration>
</execution>