diff --git a/.github/CI-ARCHITECTURE.md b/.github/CI-ARCHITECTURE.md index 1214e5d375894..ebdcaf541c4ae 100644 --- a/.github/CI-ARCHITECTURE.md +++ b/.github/CI-ARCHITECTURE.md @@ -34,7 +34,7 @@ PR comment: /component-test kafka http ### `pr-build-main.yml` — Build and test - **Trigger**: `pull_request` (main branch), `workflow_dispatch` -- **Matrix**: JDK 17, 21, 25 (25 is experimental) +- **Matrix**: JDK 21, 25 (25 is experimental) - **Steps**: 1. Full build via `regen.sh` (`mvn install -DskipTests -Pregen`) 2. Check for uncommitted generated files @@ -138,7 +138,7 @@ Notes: - **The section names its JDK** (`flake-label` on the action, `--label` on the script, also recorded in `flakes.json`). The PR-comment artifact is uploaded with `overwrite: true` across the JDK matrix on the grounds that the content is - identical between entries. Flake data is the one part that is not: if JDK 17 + identical between entries. Flake data is the one part that is not: if JDK 21 flakes and JDK 25 does not, whichever finishes last decides what the comment shows. The label means the reader can tell which entry a shown flake came from, and the per-JDK artifacts remain the complete record. @@ -260,7 +260,7 @@ source-artifact-id:it-module-path:command ## Multi-JDK Artifact Behavior -All non-experimental JDK matrix entries (17, 21) upload the CI comment artifact with `overwrite: true`. This ensures a comment is posted even if one JDK build fails. Since the comment content is identical across JDKs (same modules are tested regardless of JDK version), last writer wins. +All non-experimental JDK matrix entries (21) upload the CI comment artifact with `overwrite: true`. This ensures a comment is posted even if one JDK build fails. Since the comment content is identical across JDKs (same modules are tested regardless of JDK version), last writer wins. ## Comment Markers diff --git a/.github/workflows/pr-build-main.yml b/.github/workflows/pr-build-main.yml index 7d8cc482c0890..97b570a07554c 100644 --- a/.github/workflows/pr-build-main.yml +++ b/.github/workflows/pr-build-main.yml @@ -71,13 +71,8 @@ jobs: continue-on-error: ${{ matrix.experimental }} strategy: matrix: - java: ['17', '25'] + java: ['21', '25'] experimental: [ false ] - include: - - java: '17' - # JDK 17 is kept for runtime compatibility testing. - # Skip the enforcer which requires JDK 21+ (needed to compile JDK 21-specific classes). - maven_extra_args: '-Denforcer.phase=none' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -218,7 +213,7 @@ jobs: # The comment content is identical across JDKs (same modules tested), # so last writer wins. However, we only upload (and overwrite) when the # comment file actually exists — a cancelled build (e.g., JDK 25 killed - # while JDK 17 fails) won't have the file and must not overwrite an + # while JDK 21 fails) won't have the file and must not overwrite an # artifact from a matrix entry that did produce it. # # The recovered-flake section is the one part that is NOT identical across diff --git a/AGENTS.md b/AGENTS.md index 745081ed5e706..d7e8e787f4c06 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,7 @@ Guidelines for AI agents working on this codebase. Apache Camel is an integration framework supporting routing rules in Java, XML and YAML DSLs. - Version: 4.24.0-SNAPSHOT -- Java: 17+ +- Java: 21+ - Build: Maven 3.9.12+ ## AI Agent Rules of Engagement diff --git a/Jenkinsfile b/Jenkinsfile index 8367ae844760f..1d3b3b0e50e03 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,6 @@ def MAVEN_PARAMS = "-B -e -fae -V -Dnoassembly -Dsurefire.rerunFailingTestsCount=2 -Dfailsafe.rerunFailingTestsCount=1" def MAVEN_TEST_PARAMS = env.MAVEN_TEST_PARAMS ?: "-Dci.env.name=apache.org" def MAVEN_TEST_PARAMS_UBUNTU = env.MAVEN_TEST_PARAMS ?: "-Dci.env.name=apache.org" -def MAVEN_JDK_17_PARAMS = "-Denforcer.skip=true" /* Below parameters are required for camel/core/camel-core module's test cases to pass on ppc64 and s390x - xpathExprGrpLimit: limits the number of groups an Xpath expression can contain @@ -52,7 +51,7 @@ pipeline { parameters { booleanParam(name: 'VIRTUAL_THREAD', defaultValue: false, description: 'Perform the build using virtual threads') choice(name: 'PLATFORM_FILTER', choices: ['all', 'ppc64le', 's390x', 'ubuntu-avx'], description: 'Run on specific platform') - choice(name: 'JDK_FILTER', choices: ['all', 'jdk_17_latest' ,'jdk_21_latest', 'jdk_25_latest'], description: 'Run on specific jdk') + choice(name: 'JDK_FILTER', choices: ['all', 'jdk_21_latest', 'jdk_25_latest'], description: 'Run on specific jdk') } agent none stages { @@ -77,7 +76,7 @@ pipeline { axes { axis { name 'JDK_NAME' - values 'jdk_17_latest', 'jdk_21_latest', 'jdk_25_latest' + values 'jdk_21_latest', 'jdk_25_latest' } axis { name 'PLATFORM' @@ -85,26 +84,6 @@ pipeline { } } excludes { - exclude { - axis { - name 'JDK_NAME' - values 'jdk_17_latest' - } - axis { - name 'PLATFORM' - values 'ppc64le' - } - } - exclude { - axis { - name 'JDK_NAME' - values 'jdk_17_latest' - } - axis { - name 'PLATFORM' - values 's390x' - } - } exclude { axis { name 'JDK_NAME' @@ -165,8 +144,6 @@ pipeline { if ("${JDK_NAME}" == "jdk_21_latest") { // Enable virtual threads and coverage required later by Sonar check sh "./mvnw $MAVEN_PARAMS $MAVEN_TEST_PARAMS_UBUNTU -Darchetype.test.skip -Dmaven.test.failure.ignore=true -Dcheckstyle.skip=true install -Dcamel.threads.virtual.enabled=${params.VIRTUAL_THREAD} -Pcoverage" - } else if ("${JDK_NAME}" == "jdk_17_latest") { - sh "./mvnw $MAVEN_PARAMS $MAVEN_TEST_PARAMS $MAVEN_JDK_17_PARAMS -Darchetype.test.skip -Dmaven.test.failure.ignore=true -Dcheckstyle.skip=true install" } else { sh "./mvnw $MAVEN_PARAMS $MAVEN_TEST_PARAMS -Darchetype.test.skip -Dmaven.test.failure.ignore=true -Dcheckstyle.skip=true install" } diff --git a/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml b/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml index 6e11e4c54b1ff..21ae7cce0ba94 100644 --- a/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml +++ b/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml @@ -91,7 +91,7 @@ maven-compiler-plugin ${maven-compiler-plugin-version} - 17 + 21 diff --git a/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/pom.xml b/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/pom.xml index 8a9b4f7b1ff0a..ce78d088170f1 100644 --- a/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/pom.xml @@ -56,7 +56,7 @@ maven-compiler-plugin ${maven-compiler-plugin-version} - 17 + 21 diff --git a/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml b/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml index fc65ac352ba44..5cd22ec2a9827 100644 --- a/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml @@ -84,7 +84,7 @@ maven-compiler-plugin ${maven-compiler-plugin-version} - 17 + 21 diff --git a/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/pom.xml b/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/pom.xml index 92b0876c02932..a191161816448 100644 --- a/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/camel-archetype-dataformat/src/main/resources/archetype-resources/pom.xml @@ -83,7 +83,7 @@ maven-compiler-plugin ${maven-compiler-plugin-version} - 17 + 21 diff --git a/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml b/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml index e867acd98d053..68b1e23e2b5c3 100644 --- a/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/camel-archetype-java/src/main/resources/archetype-resources/pom.xml @@ -88,7 +88,7 @@ maven-compiler-plugin ${maven-compiler-plugin-version} - 17 + 21 diff --git a/archetypes/camel-archetype-main/src/main/resources/archetype-resources/pom.xml b/archetypes/camel-archetype-main/src/main/resources/archetype-resources/pom.xml index 2dc7c4a91d3ec..1b349865e939f 100644 --- a/archetypes/camel-archetype-main/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/camel-archetype-main/src/main/resources/archetype-resources/pom.xml @@ -104,7 +104,7 @@ maven-compiler-plugin ${maven-compiler-plugin-version} - 17 + 21 diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/crypto-dataformat.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/crypto-dataformat.adoc index 37d1c979e4513..76ca4feeb9cee 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/crypto-dataformat.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/crypto-dataformat.adoc @@ -115,7 +115,7 @@ from("direct:hmac-algorithm") .to("mock:unencrypted"); ---- -A list of the available algorithms in Java 17 is available via the https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html[Java Security Standard Algorithm Names] documentation. +A list of the available algorithms in Java 21 is available via the https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html[Java Security Standard Algorithm Names] documentation. == Specifying an Initialization Vector diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ldap-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ldap-component.adoc index 6f642f84968ce..7238a2d0bf7f4 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ldap-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ldap-component.adoc @@ -37,7 +37,7 @@ ldap:ldapServerBean[?options] ---- The _ldapServerBean_ portion of the URI refers to a -https://docs.oracle.com/en/java/javase/17/docs/api/java.naming/javax/naming/directory/DirContext.html[DirContext] +https://docs.oracle.com/en/java/javase/21/docs/api/java.naming/javax/naming/directory/DirContext.html[DirContext] bean in the registry. The LDAP component only supports producer endpoints, which means that an `ldap` URI cannot appear in the `from` at the start of a route. diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc index a780e2eabb675..75306c4f9e1f1 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc @@ -356,19 +356,19 @@ The camel.ssl supports 28 options, which are listed below. | `camel.ssl.cipherSuitesInclude` | Filters TLS/SSL cipher suites algorithms names. This filter is used for including algorithms that matches the naming pattern. Multiple names can be separated by comma. Notice that if the cipherSuites option has been configured then the include/exclude filters are not in use. | | String | `camel.ssl.clientAuthentication` | Sets the configuration for server-side client-authentication requirements | NONE | String | `camel.ssl.enabled` | Enables SSL in your Camel application. | false | boolean -| `camel.ssl.keyManagerAlgorithm` | Algorithm name used for creating the KeyManagerFactory. See \https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html | | String +| `camel.ssl.keyManagerAlgorithm` | Algorithm name used for creating the KeyManagerFactory. See \https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html | | String | `camel.ssl.keyManagerProvider` | To use a specific provider for creating KeyManagerFactory. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol. | | String | `camel.ssl.keyStore` | The key store to load. The key store is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development). | | String | `camel.ssl.keystorePassword` | Sets the SSL Keystore password. | | String | `camel.ssl.keyStoreProvider` | To use a specific provider for creating KeyStore. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol. | | String -| `camel.ssl.keyStoreType` | The type of the key store to load. See \https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html | | String +| `camel.ssl.keyStoreType` | The type of the key store to load. See \https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html | | String | `camel.ssl.namedGroups` | List of TLS/SSL named groups (key exchange groups). Multiple names can be separated by comma. Named groups control which key exchange algorithms are available during the TLS handshake, including post-quantum hybrid groups such as X25519MLKEM768. | | String | `camel.ssl.namedGroupsExclude` | Filters TLS/SSL named groups. This filter is used for excluding named groups that match the naming pattern. Multiple names can be separated by comma. Notice that if the namedGroups option has been configured then the include/exclude filters are not in use. | | String | `camel.ssl.namedGroupsInclude` | Filters TLS/SSL named groups. This filter is used for including named groups that match the naming pattern. Multiple names can be separated by comma. Notice that if the namedGroups option has been configured then the include/exclude filters are not in use. | | String | `camel.ssl.provider` | To use a specific provider for creating SSLContext. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol. | | String -| `camel.ssl.secureRandomAlgorithm` | Algorithm name used for creating the SecureRandom. See \https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html | | String +| `camel.ssl.secureRandomAlgorithm` | Algorithm name used for creating the SecureRandom. See \https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html | | String | `camel.ssl.secureRandomProvider` | To use a specific provider for creating SecureRandom. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol. | | String -| `camel.ssl.secureSocketProtocol` | The protocol for the secure sockets created by the SSLContext. See \https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html | TLSv1.3 | String +| `camel.ssl.secureSocketProtocol` | The protocol for the secure sockets created by the SSLContext. See \https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html | TLSv1.3 | String | `camel.ssl.selfSigned` | Whether to generate a self-signed certificate for development use when no keystore is configured. This can be used in development environment to easily enable HTTPS without providing a keystore. Do NOT use this in production as the certificate is not trusted and is regenerated on each restart. | false | boolean | `camel.ssl.selfSignedKeyType` | The key algorithm to use when generating the self-signed certificate for development use (requires selfSigned to be enabled). Supported values are EC (default, NIST P-256) and RSA (2048-bit). | EC | String | `camel.ssl.sessionTimeout` | Timeout in seconds to use for SSLContext. The default is 24 hours. | 86400 | int diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json index cd2101ee33b79..ddd3fcbbdbe87 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json @@ -474,19 +474,19 @@ { "name": "camel.ssl.cipherSuitesInclude", "required": false, "description": "Filters TLS\/SSL cipher suites algorithms names. This filter is used for including algorithms that matches the naming pattern. Multiple names can be separated by comma. Notice that if the cipherSuites option has been configured then the include\/exclude filters are not in use.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.clientAuthentication", "required": false, "description": "Sets the configuration for server-side client-authentication requirements", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "enum", "javaType": "java.lang.String", "defaultValue": "NONE", "secret": false, "enum": [ "NONE", "WANT", "REQUIRE" ] }, { "name": "camel.ssl.enabled", "required": false, "description": "Enables SSL in your Camel application.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": false }, - { "name": "camel.ssl.keyManagerAlgorithm", "required": false, "description": "Algorithm name used for creating the KeyManagerFactory. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, + { "name": "camel.ssl.keyManagerAlgorithm", "required": false, "description": "Algorithm name used for creating the KeyManagerFactory. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.keyManagerProvider", "required": false, "description": "To use a specific provider for creating KeyManagerFactory. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.keyStore", "required": false, "description": "The key store to load. The key store is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development).", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.keystorePassword", "required": false, "description": "Sets the SSL Keystore password.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": true, "security": "secret" }, { "name": "camel.ssl.keyStoreProvider", "required": false, "description": "To use a specific provider for creating KeyStore. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, - { "name": "camel.ssl.keyStoreType", "required": false, "description": "The type of the key store to load. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, + { "name": "camel.ssl.keyStoreType", "required": false, "description": "The type of the key store to load. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.namedGroups", "required": false, "description": "List of TLS\/SSL named groups (key exchange groups). Multiple names can be separated by comma. Named groups control which key exchange algorithms are available during the TLS handshake, including post-quantum hybrid groups such as X25519MLKEM768.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.namedGroupsExclude", "required": false, "description": "Filters TLS\/SSL named groups. This filter is used for excluding named groups that match the naming pattern. Multiple names can be separated by comma. Notice that if the namedGroups option has been configured then the include\/exclude filters are not in use.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.namedGroupsInclude", "required": false, "description": "Filters TLS\/SSL named groups. This filter is used for including named groups that match the naming pattern. Multiple names can be separated by comma. Notice that if the namedGroups option has been configured then the include\/exclude filters are not in use.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.provider", "required": false, "description": "To use a specific provider for creating SSLContext. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, - { "name": "camel.ssl.secureRandomAlgorithm", "required": false, "description": "Algorithm name used for creating the SecureRandom. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, + { "name": "camel.ssl.secureRandomAlgorithm", "required": false, "description": "Algorithm name used for creating the SecureRandom. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.secureRandomProvider", "required": false, "description": "To use a specific provider for creating SecureRandom. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, - { "name": "camel.ssl.secureSocketProtocol", "required": false, "description": "The protocol for the secure sockets created by the SSLContext. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "TLSv1.3", "secret": false }, + { "name": "camel.ssl.secureSocketProtocol", "required": false, "description": "The protocol for the secure sockets created by the SSLContext. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "TLSv1.3", "secret": false }, { "name": "camel.ssl.selfSigned", "required": false, "description": "Whether to generate a self-signed certificate for development use when no keystore is configured. This can be used in development environment to easily enable HTTPS without providing a keystore. Do NOT use this in production as the certificate is not trusted and is regenerated on each restart.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": false }, { "name": "camel.ssl.selfSignedKeyType", "required": false, "description": "The key algorithm to use when generating the self-signed certificate for development use (requires selfSigned to be enabled). Supported values are EC (default, NIST P-256) and RSA (2048-bit).", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "enum", "javaType": "java.lang.String", "defaultValue": "EC", "secret": false, "enum": [ "EC", "RSA" ] }, { "name": "camel.ssl.sessionTimeout", "required": false, "description": "Timeout in seconds to use for SSLContext. The default is 24 hours.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 86400, "secret": false }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models-app/sslContextParameters.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models-app/sslContextParameters.json index c47cc7ab17587..b9e5fb919b524 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models-app/sslContextParameters.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models-app/sslContextParameters.json @@ -14,7 +14,7 @@ "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this SSL configuration." }, "provider": { "index": 1, "kind": "attribute", "displayName": "Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a specific provider for creating SSLContext. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol." }, - "secureSocketProtocol": { "index": 2, "kind": "attribute", "displayName": "Secure Socket Protocol", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TLSv1.3", "description": "The protocol for the secure sockets created by the SSLContext. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "secureSocketProtocol": { "index": 2, "kind": "attribute", "displayName": "Secure Socket Protocol", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TLSv1.3", "description": "The protocol for the secure sockets created by the SSLContext. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "certAlias": { "index": 3, "kind": "attribute", "displayName": "Cert Alias", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "An optional certificate alias to use. This is useful when the keystore has multiple certificates." }, "sessionTimeout": { "index": 4, "kind": "attribute", "displayName": "Session Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "86400", "description": "Timeout in seconds to use for SSLContext. The default is 24 hours." }, "cipherSuites": { "index": 5, "kind": "attribute", "displayName": "Cipher Suites", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "List of TLS\/SSL cipher suite algorithm names. Multiple names can be separated by comma." }, @@ -27,15 +27,15 @@ "signatureSchemesInclude": { "index": 12, "kind": "attribute", "displayName": "Signature Schemes Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters TLS\/SSL signature schemes. This filter is used for including signature schemes that match the naming pattern. Multiple names can be separated by comma. Notice that if the signatureSchemes option has been configured then the include\/exclude filters are not in use." }, "signatureSchemesExclude": { "index": 13, "kind": "attribute", "displayName": "Signature Schemes Exclude", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters TLS\/SSL signature schemes. This filter is used for excluding signature schemes that match the naming pattern. Multiple names can be separated by comma. Notice that if the signatureSchemes option has been configured then the include\/exclude filters are not in use." }, "keyStore": { "index": 14, "kind": "attribute", "displayName": "Key Store", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The key store to load. The key store is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development)." }, - "keyStoreType": { "index": 15, "kind": "attribute", "displayName": "Key Store Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of the key store to load. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "keyStoreType": { "index": 15, "kind": "attribute", "displayName": "Key Store Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of the key store to load. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "keyStoreProvider": { "index": 16, "kind": "attribute", "displayName": "Key Store Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a specific provider for creating KeyStore. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol." }, "keystorePassword": { "index": 17, "kind": "attribute", "displayName": "Keystore Password", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the SSL Keystore password." }, "trustStore": { "index": 18, "kind": "attribute", "displayName": "Trust Store", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The trust store to load. The trust store is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development)." }, "trustStorePassword": { "index": 19, "kind": "attribute", "displayName": "Trust Store Password", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the SSL Truststore password." }, "trustAllCertificates": { "index": 20, "kind": "attribute", "displayName": "Trust All Certificates", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Allows to trust all SSL certificates without performing certificate validation. This can be used in development environment but may expose the system to security risks. Notice that if the trustAllCertificates option is set to true then the trustStore\/trustStorePassword options are not in use." }, - "keyManagerAlgorithm": { "index": 21, "kind": "attribute", "displayName": "Key Manager Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Algorithm name used for creating the KeyManagerFactory. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "keyManagerAlgorithm": { "index": 21, "kind": "attribute", "displayName": "Key Manager Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Algorithm name used for creating the KeyManagerFactory. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "keyManagerProvider": { "index": 22, "kind": "attribute", "displayName": "Key Manager Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a specific provider for creating KeyManagerFactory. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol." }, - "secureRandomAlgorithm": { "index": 23, "kind": "attribute", "displayName": "Secure Random Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Algorithm name used for creating the SecureRandom. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "secureRandomAlgorithm": { "index": 23, "kind": "attribute", "displayName": "Secure Random Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Algorithm name used for creating the SecureRandom. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "secureRandomProvider": { "index": 24, "kind": "attribute", "displayName": "Secure Random Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a specific provider for creating SecureRandom. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol." }, "clientAuthentication": { "index": 25, "kind": "attribute", "displayName": "Client Authentication", "group": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "NONE", "description": "Sets the configuration for server-side client-authentication requirements." } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd index 278dd6cd0df9f..bb2401fcae2f7 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd @@ -3030,7 +3030,7 @@ The password for reading/opening/verifying the key store. @@ -3066,7 +3066,7 @@ To lookup an existing KeyStore instance from the registry, for example for testi @@ -17616,7 +17616,7 @@ The provider identifier for the JSSE implementation to use when constructing an diff --git a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2AsyncMDNServerConnection.java b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2AsyncMDNServerConnection.java index 731ca3d4d1c0d..dee0ffb7f4780 100644 --- a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2AsyncMDNServerConnection.java +++ b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2AsyncMDNServerConnection.java @@ -195,9 +195,7 @@ public RequestHandlerThread(HttpService httpService, Socket inSocket) throws IOE // NOTE: the connection will be closed after the execution of the process. AS2BHttpServerConnection inConn = new AS2BHttpServerConnection(cfg); // NOSONAR inConn.bind(inSocket); - // TODO Update once baseline is Java 21 - // setName(REQUEST_HANDLER_THREAD_NAME_PREFIX + threadId()); - setName(REQUEST_HANDLER_THREAD_NAME_PREFIX + getId()); + setName(REQUEST_HANDLER_THREAD_NAME_PREFIX + threadId()); this.httpService = httpService; this.serverConnection = inConn; } diff --git a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ServerConnection.java b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ServerConnection.java index 83dfcc1b52d4e..1270448dc5ee2 100644 --- a/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ServerConnection.java +++ b/components/camel-as2/camel-as2-api/src/main/java/org/apache/camel/component/as2/api/AS2ServerConnection.java @@ -490,9 +490,7 @@ public RequestHandlerThread(HttpService httpService, Socket inSocket) throws IOE LOG.info("Incoming connection from {}", inSocket.getInetAddress()); inConn.bind(inSocket); - // TODO Update once baseline is Java 21 - // setName(REQUEST_HANDLER_THREAD_NAME_PREFIX + threadId()); - setName(REQUEST_HANDLER_THREAD_NAME_PREFIX + getId()); + setName(REQUEST_HANDLER_THREAD_NAME_PREFIX + threadId()); this.httpService = httpService; this.serverConnection = inConn; diff --git a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormattingOptions.java b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormattingOptions.java index 79af598dfa2c8..1422bfcfde8d3 100644 --- a/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormattingOptions.java +++ b/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/FormattingOptions.java @@ -123,9 +123,7 @@ private Locale getLocale(String locale) { if (ObjectHelper.isNotEmpty(locale)) { String[] result = locale.split("-"); if (result.length <= 2) { - // TODO Update once baseline is Java 21 - // answer = result.length == 1 ? Locale.of(result[0]) : Locale.of(result[0], result[1]); - answer = result.length == 1 ? new Locale(result[0]) : new Locale(result[0], result[1]); + answer = result.length == 1 ? Locale.of(result[0]) : Locale.of(result[0], result[1]); } } return answer; diff --git a/components/camel-crypto/src/main/docs/crypto-dataformat.adoc b/components/camel-crypto/src/main/docs/crypto-dataformat.adoc index 37d1c979e4513..76ca4feeb9cee 100644 --- a/components/camel-crypto/src/main/docs/crypto-dataformat.adoc +++ b/components/camel-crypto/src/main/docs/crypto-dataformat.adoc @@ -115,7 +115,7 @@ from("direct:hmac-algorithm") .to("mock:unencrypted"); ---- -A list of the available algorithms in Java 17 is available via the https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html[Java Security Standard Algorithm Names] documentation. +A list of the available algorithms in Java 21 is available via the https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html[Java Security Standard Algorithm Names] documentation. == Specifying an Initialization Vector diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java index 39043bd8aad8b..296d548ba0706 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java @@ -273,7 +273,7 @@ public Entity bindCamelMessageToRequestEntity( if (contentLanguage != null) { return Entity.entity(body, new Variant( MediaType.valueOf(contentType), - new Locale(contentLanguage), + Locale.forLanguageTag(contentLanguage), contentEncoding)); } } diff --git a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryProducer.java b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryProducer.java index 6a80d98489448..73533603e1c77 100644 --- a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryProducer.java +++ b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryProducer.java @@ -172,9 +172,7 @@ private int process(String tableId, String partitionDecorator, String suffix, Li apiRequestRows.size(), tableId, suffix, partitionDecorator); } if (LOG.isDebugEnabled()) { - // TODO Update once baseline is Java 21 - // LOG.debug("uploader thread/id: {} / {} . api call completed.", Thread.currentThread().threadId(), exchangeId); - LOG.debug("uploader thread/id: {} / {} . api call completed.", Thread.currentThread().getId(), exchangeId); + LOG.debug("uploader thread/id: {} / {} . api call completed.", Thread.currentThread().threadId(), exchangeId); } return insertAllRequest.getRows().size(); } diff --git a/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubProducer.java b/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubProducer.java index d295dc870ab77..31b54f5d103b8 100644 --- a/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubProducer.java +++ b/components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubProducer.java @@ -62,10 +62,7 @@ public GooglePubsubProducer(GooglePubsubEndpoint endpoint) { public void process(Exchange exchange) throws Exception { if (logger.isDebugEnabled()) { - // TODO Update once baseline is Java 21 - // logger.debug("uploader thread/id: {} / {}. api call completed.", Thread.currentThread().threadId(), - // exchange.getExchangeId()); - logger.debug("uploader thread/id: {} / {}. api call completed.", Thread.currentThread().getId(), + logger.debug("uploader thread/id: {} / {}. api call completed.", Thread.currentThread().threadId(), exchange.getExchangeId()); } diff --git a/components/camel-ldap/src/main/docs/ldap-component.adoc b/components/camel-ldap/src/main/docs/ldap-component.adoc index 6f642f84968ce..7238a2d0bf7f4 100644 --- a/components/camel-ldap/src/main/docs/ldap-component.adoc +++ b/components/camel-ldap/src/main/docs/ldap-component.adoc @@ -37,7 +37,7 @@ ldap:ldapServerBean[?options] ---- The _ldapServerBean_ portion of the URI refers to a -https://docs.oracle.com/en/java/javase/17/docs/api/java.naming/javax/naming/directory/DirContext.html[DirContext] +https://docs.oracle.com/en/java/javase/21/docs/api/java.naming/javax/naming/directory/DirContext.html[DirContext] bean in the registry. The LDAP component only supports producer endpoints, which means that an `ldap` URI cannot appear in the `from` at the start of a route. diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java index b5d3816701070..a572368a0522c 100644 --- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java +++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java @@ -198,11 +198,8 @@ private void reconnect() { reconnectLock.unlock(); } } else { - // TODO Update once baseline is Java 21 - // LOG.warn("Thread {} could not acquire a lock for creating the session during consumer reconnection", - // Thread.currentThread().threadId()); LOG.warn("Thread {} could not acquire a lock for creating the session during consumer reconnection", - Thread.currentThread().getId()); + Thread.currentThread().threadId()); } } diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java index 78d16d9b442ae..eff257679df95 100644 --- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java +++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java @@ -93,11 +93,8 @@ protected void doStart() throws Exception { connectLock.unlock(); } } else { - // TODO Update once baseline is Java 21 - // LOG.warn("Thread {} could not acquire a lock for creating the session during producer start", - // Thread.currentThread().threadId()); LOG.warn("Thread {} could not acquire a lock for creating the session during producer start", - Thread.currentThread().getId()); + Thread.currentThread().threadId()); } } } @@ -172,11 +169,8 @@ public void process(Exchange exchange) throws Exception { connectLock.unlock(); } } else { - // TODO Update once baseline is Java 21 - // LOG.warn("Thread {} could not acquire a lock for creating the session during lazy initialization", - // Thread.currentThread().threadId()); LOG.warn("Thread {} could not acquire a lock for creating the session during lazy initialization", - Thread.currentThread().getId()); + Thread.currentThread().threadId()); } } } @@ -223,11 +217,8 @@ private void reconnect() { connectLock.unlock(); } } else { - // TODO Update once baseline is Java 21 - // LOG.warn("Thread {} could not acquire a lock for creating the session during producer reconnection", - // Thread.currentThread().threadId()); LOG.warn("Thread {} could not acquire a lock for creating the session during producer reconnection", - Thread.currentThread().getId()); + Thread.currentThread().threadId()); } } diff --git a/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/keyStoreParameters.json b/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/keyStoreParameters.json index 4da11dce0eb54..19e1e3f10a8d7 100644 --- a/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/keyStoreParameters.json +++ b/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/keyStoreParameters.json @@ -15,7 +15,7 @@ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, "resource": { "index": 1, "kind": "attribute", "displayName": "Resource", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The keystore to load. The keystore is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development)" }, "password": { "index": 2, "kind": "attribute", "displayName": "Password", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The password for reading\/opening\/verifying the key store" }, - "type": { "index": 3, "kind": "attribute", "displayName": "Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of the key store to create and load. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "type": { "index": 3, "kind": "attribute", "displayName": "Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of the key store to create and load. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "provider": { "index": 4, "kind": "attribute", "displayName": "Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The provider identifier for instantiating the key store" }, "keyStore": { "index": 5, "kind": "attribute", "displayName": "Key Store", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To lookup an existing KeyStore instance from the registry, for example for testing and development" }, "camelContextId": { "index": 6, "kind": "attribute", "displayName": "Camel Context Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Id of CamelContext to use if there are multiple CamelContexts in the same JVM" } diff --git a/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/secureRandomParameters.json b/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/secureRandomParameters.json index c1f34d07a527d..1fc9f577cc181 100644 --- a/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/secureRandomParameters.json +++ b/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/secureRandomParameters.json @@ -13,7 +13,7 @@ }, "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, - "algorithm": { "index": 1, "kind": "attribute", "displayName": "Algorithm", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Random Number Generator algorithm identifier for the SecureRandom factory method used to create the SecureRandom represented by this object's configuration. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "algorithm": { "index": 1, "kind": "attribute", "displayName": "Algorithm", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Random Number Generator algorithm identifier for the SecureRandom factory method used to create the SecureRandom represented by this object's configuration. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "provider": { "index": 2, "kind": "attribute", "displayName": "Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The provider identifier for the SecureRandom factory method used to create the SecureRandom represented by this object's configuration." }, "camelContextId": { "index": 3, "kind": "attribute", "displayName": "Camel Context Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Id of CamelContext to use if there are multiple CamelContexts in the same JVM" } } diff --git a/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/sslContextParameters.json b/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/sslContextParameters.json index febf4e4135860..11cc8d72dcc54 100644 --- a/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/sslContextParameters.json +++ b/components/camel-spring-parent/camel-spring-xml/src/generated/resources/META-INF/org/apache/camel/spring/xml/sslContextParameters.json @@ -14,7 +14,7 @@ "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" }, "provider": { "index": 1, "kind": "attribute", "displayName": "Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The provider identifier for the JSSE implementation to use when constructing an SSLContext." }, - "secureSocketProtocol": { "index": 2, "kind": "attribute", "displayName": "Secure Socket Protocol", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The protocol for the secure sockets created by the SSLContext represented by this instance's configuration. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "secureSocketProtocol": { "index": 2, "kind": "attribute", "displayName": "Secure Socket Protocol", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The protocol for the secure sockets created by the SSLContext represented by this instance's configuration. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "certAlias": { "index": 3, "kind": "attribute", "displayName": "Cert Alias", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "An optional certificate alias to use. This is useful when the keystore has multiple certificates." }, "sessionTimeout": { "index": 4, "kind": "attribute", "displayName": "Session Timeout", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The optional SSLSessionContext timeout time for javax.net.ssl.SSLSession in seconds." }, "camelContextId": { "index": 5, "kind": "attribute", "displayName": "Camel Context Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Id of CamelContext to use if there are multiple CamelContexts in the same JVM" } diff --git a/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyManagersParameters.java b/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyManagersParameters.java index 2dc57e9fb2f26..7c140d5f7a9f3 100644 --- a/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyManagersParameters.java +++ b/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyManagersParameters.java @@ -141,7 +141,7 @@ public void setProvider(@Nullable String value) { * The algorithm name for the {@link KeyManagerFactory} used to create the {@link KeyManager}s represented by this * object's configuration. See the * - * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html * * @param value the desired algorithm or {@code null} to use default * @see KeyManagerFactory#getDefaultAlgorithm() diff --git a/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java b/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java index c4dcd4681e53c..74e8d64127fc0 100644 --- a/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java +++ b/core/camel-api/src/main/java/org/apache/camel/support/jsse/KeyStoreParameters.java @@ -50,7 +50,7 @@ public class KeyStoreParameters extends JsseParameters { /** * The type of the key store to create and load. * - * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public void setType(@Nullable String value) { this.type = value; diff --git a/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java b/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java index c03190c780608..093d50a82dc15 100644 --- a/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java +++ b/core/camel-api/src/main/java/org/apache/camel/support/jsse/SSLContextParameters.java @@ -101,7 +101,7 @@ public class SSLContextParameters extends BaseSSLContextParameters { * The optional protocol for the secure sockets created by the {@link SSLContext} represented by this instance's * configuration. * - * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ private @Nullable String secureSocketProtocol; @@ -212,7 +212,7 @@ public String getSecureSocketProtocol() { * Sets the optional protocol for the secure sockets created by the {@link SSLContext} represented by this * instance's configuration. Defaults to TLS. * - * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html * * @param secureSocketProtocol the name of the protocol or {@code null} to use the default (TLS) */ diff --git a/core/camel-api/src/main/java/org/apache/camel/support/jsse/SecureRandomParameters.java b/core/camel-api/src/main/java/org/apache/camel/support/jsse/SecureRandomParameters.java index 9ab5bd5eb72e4..5b68c31fee286 100644 --- a/core/camel-api/src/main/java/org/apache/camel/support/jsse/SecureRandomParameters.java +++ b/core/camel-api/src/main/java/org/apache/camel/support/jsse/SecureRandomParameters.java @@ -64,7 +64,7 @@ public SecureRandom createSecureRandom() throws GeneralSecurityException { * Sets the Random Number Generator (RNG) algorithm identifier for the {@link SecureRandom} factory method used to * create the {@link SecureRandom} represented by this object's configuration. * - * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html * * @param value the algorithm identifier */ diff --git a/core/camel-api/src/main/java/org/apache/camel/support/jsse/TrustManagersParameters.java b/core/camel-api/src/main/java/org/apache/camel/support/jsse/TrustManagersParameters.java index 3a021422dcd79..4188b752f9e6a 100644 --- a/core/camel-api/src/main/java/org/apache/camel/support/jsse/TrustManagersParameters.java +++ b/core/camel-api/src/main/java/org/apache/camel/support/jsse/TrustManagersParameters.java @@ -125,7 +125,7 @@ public void setProvider(@Nullable String value) { * Sets optional algorithm name for the {@link TrustManagerFactory} used to create the {@link TrustManager}s * represented by this object's configuration. * - * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html * * @param value the desired algorithm or {@code null} to use default * @see TrustManagerFactory#getDefaultAlgorithm() diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java index fd52d530b1c6c..e831514cb6687 100644 --- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java +++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultAsyncProcessorAwaitManager.java @@ -259,9 +259,7 @@ private static String dumpBlockedThread(AwaitThread entry) { sb.append( "---------------------------------------------------------------------------------------------------------------------------------------\n"); - // TODO Update once baseline is Java 21 - // sb.append(style("Id:")).append(entry.getBlockedThread().threadId()).append("\n"); - sb.append(style("Id:")).append(entry.getBlockedThread().getId()).append("\n"); + sb.append(style("Id:")).append(entry.getBlockedThread().threadId()).append("\n"); sb.append(style("Name:")).append(entry.getBlockedThread().getName()).append("\n"); sb.append(style("RouteId:")).append(safeNull(entry.getRouteId())).append("\n"); sb.append(style("NodeId:")).append(safeNull(entry.getNodeId())).append("\n"); diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/app/sslContextParameters.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/app/sslContextParameters.json index c47cc7ab17587..b9e5fb919b524 100644 --- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/app/sslContextParameters.json +++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/app/sslContextParameters.json @@ -14,7 +14,7 @@ "properties": { "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this SSL configuration." }, "provider": { "index": 1, "kind": "attribute", "displayName": "Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a specific provider for creating SSLContext. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol." }, - "secureSocketProtocol": { "index": 2, "kind": "attribute", "displayName": "Secure Socket Protocol", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TLSv1.3", "description": "The protocol for the secure sockets created by the SSLContext. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "secureSocketProtocol": { "index": 2, "kind": "attribute", "displayName": "Secure Socket Protocol", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TLSv1.3", "description": "The protocol for the secure sockets created by the SSLContext. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "certAlias": { "index": 3, "kind": "attribute", "displayName": "Cert Alias", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "An optional certificate alias to use. This is useful when the keystore has multiple certificates." }, "sessionTimeout": { "index": 4, "kind": "attribute", "displayName": "Session Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "86400", "description": "Timeout in seconds to use for SSLContext. The default is 24 hours." }, "cipherSuites": { "index": 5, "kind": "attribute", "displayName": "Cipher Suites", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "List of TLS\/SSL cipher suite algorithm names. Multiple names can be separated by comma." }, @@ -27,15 +27,15 @@ "signatureSchemesInclude": { "index": 12, "kind": "attribute", "displayName": "Signature Schemes Include", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters TLS\/SSL signature schemes. This filter is used for including signature schemes that match the naming pattern. Multiple names can be separated by comma. Notice that if the signatureSchemes option has been configured then the include\/exclude filters are not in use." }, "signatureSchemesExclude": { "index": 13, "kind": "attribute", "displayName": "Signature Schemes Exclude", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Filters TLS\/SSL signature schemes. This filter is used for excluding signature schemes that match the naming pattern. Multiple names can be separated by comma. Notice that if the signatureSchemes option has been configured then the include\/exclude filters are not in use." }, "keyStore": { "index": 14, "kind": "attribute", "displayName": "Key Store", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The key store to load. The key store is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development)." }, - "keyStoreType": { "index": 15, "kind": "attribute", "displayName": "Key Store Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of the key store to load. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "keyStoreType": { "index": 15, "kind": "attribute", "displayName": "Key Store Type", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The type of the key store to load. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "keyStoreProvider": { "index": 16, "kind": "attribute", "displayName": "Key Store Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a specific provider for creating KeyStore. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol." }, "keystorePassword": { "index": 17, "kind": "attribute", "displayName": "Keystore Password", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the SSL Keystore password." }, "trustStore": { "index": 18, "kind": "attribute", "displayName": "Trust Store", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The trust store to load. The trust store is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development)." }, "trustStorePassword": { "index": 19, "kind": "attribute", "displayName": "Trust Store Password", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the SSL Truststore password." }, "trustAllCertificates": { "index": 20, "kind": "attribute", "displayName": "Trust All Certificates", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Allows to trust all SSL certificates without performing certificate validation. This can be used in development environment but may expose the system to security risks. Notice that if the trustAllCertificates option is set to true then the trustStore\/trustStorePassword options are not in use." }, - "keyManagerAlgorithm": { "index": 21, "kind": "attribute", "displayName": "Key Manager Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Algorithm name used for creating the KeyManagerFactory. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "keyManagerAlgorithm": { "index": 21, "kind": "attribute", "displayName": "Key Manager Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Algorithm name used for creating the KeyManagerFactory. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "keyManagerProvider": { "index": 22, "kind": "attribute", "displayName": "Key Manager Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a specific provider for creating KeyManagerFactory. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol." }, - "secureRandomAlgorithm": { "index": 23, "kind": "attribute", "displayName": "Secure Random Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Algorithm name used for creating the SecureRandom. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html" }, + "secureRandomAlgorithm": { "index": 23, "kind": "attribute", "displayName": "Secure Random Algorithm", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Algorithm name used for creating the SecureRandom. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html" }, "secureRandomProvider": { "index": 24, "kind": "attribute", "displayName": "Secure Random Provider", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "To use a specific provider for creating SecureRandom. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol." }, "clientAuthentication": { "index": 25, "kind": "attribute", "displayName": "Client Authentication", "group": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "NONE", "WANT", "REQUIRE" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "NONE", "description": "Sets the configuration for server-side client-authentication requirements." } } diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/app/SSLContextParametersDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/app/SSLContextParametersDefinition.java index 3d9ca6f3f962d..bfbb92245dbe0 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/app/SSLContextParametersDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/app/SSLContextParametersDefinition.java @@ -85,7 +85,7 @@ public class SSLContextParametersDefinition { @XmlAttribute @Metadata(label = "advanced", defaultValue = "TLSv1.3", description = "The protocol for the secure sockets created by the SSLContext." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") private String secureSocketProtocol; @XmlAttribute @@ -177,7 +177,7 @@ public class SSLContextParametersDefinition { @XmlAttribute @Metadata(label = "advanced", description = "The type of the key store to load." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") private String keyStoreType; @XmlAttribute @@ -214,7 +214,7 @@ public class SSLContextParametersDefinition { @XmlAttribute @Metadata(label = "advanced", description = "Algorithm name used for creating the KeyManagerFactory." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") private String keyManagerAlgorithm; @XmlAttribute @@ -227,7 +227,7 @@ public class SSLContextParametersDefinition { @XmlAttribute @Metadata(label = "advanced", description = "Algorithm name used for creating the SecureRandom." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") private String secureRandomAlgorithm; @XmlAttribute diff --git a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractKeyManagersParametersFactoryBean.java b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractKeyManagersParametersFactoryBean.java index ba10232bdd206..f1e07c403e83b 100644 --- a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractKeyManagersParametersFactoryBean.java +++ b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractKeyManagersParametersFactoryBean.java @@ -46,7 +46,7 @@ public abstract class AbstractKeyManagersParametersFactoryBean extends AbstractJ @XmlAttribute @Metadata(label = "advanced", description = "The algorithm name for the KeyManagerFactory used to create" + " the KeyManagers represented by this object's configuration." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") protected String algorithm; @XmlTransient diff --git a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractKeyStoreParametersFactoryBean.java b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractKeyStoreParametersFactoryBean.java index 122a61d1e480c..7b7f5d1fc32fc 100644 --- a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractKeyStoreParametersFactoryBean.java +++ b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractKeyStoreParametersFactoryBean.java @@ -43,7 +43,7 @@ public abstract class AbstractKeyStoreParametersFactoryBean extends AbstractJsse protected String password; @XmlAttribute @Metadata(label = "advanced", description = "The type of the key store to create and load." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") protected String type; @XmlAttribute @Metadata(label = "advanced", description = "The provider identifier for instantiating the key store") diff --git a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractSSLContextParametersFactoryBean.java b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractSSLContextParametersFactoryBean.java index e29a61b21eade..15e494fc0fc14 100644 --- a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractSSLContextParametersFactoryBean.java +++ b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractSSLContextParametersFactoryBean.java @@ -38,7 +38,7 @@ public abstract class AbstractSSLContextParametersFactoryBean @XmlAttribute @Metadata(label = "advanced", description = "The protocol for the secure sockets created by the SSLContext" + " represented by this instance's configuration." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") private String secureSocketProtocol; @XmlAttribute diff --git a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractSecureRandomParametersFactoryBean.java b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractSecureRandomParametersFactoryBean.java index 20c4559b833de..291056fd37a15 100644 --- a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractSecureRandomParametersFactoryBean.java +++ b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractSecureRandomParametersFactoryBean.java @@ -30,7 +30,7 @@ public abstract class AbstractSecureRandomParametersFactoryBean extends Abstract @XmlAttribute(required = true) @Metadata(description = "The Random Number Generator algorithm identifier for the SecureRandom factory method used to create the SecureRandom represented by this object's configuration." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") protected String algorithm; @XmlAttribute diff --git a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractTrustManagersParametersFactoryBean.java b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractTrustManagersParametersFactoryBean.java index da833171038cc..79de0bdd6ef9d 100644 --- a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractTrustManagersParametersFactoryBean.java +++ b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/util/jsse/AbstractTrustManagersParametersFactoryBean.java @@ -39,7 +39,7 @@ public abstract class AbstractTrustManagersParametersFactoryBean extends Abstrac @XmlAttribute @Metadata(label = "advanced", description = "The optional algorithm name for the TrustManagerFactory used to" + " create the TrustManagers represented by this objects configuration." - + " See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html") + + " See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html") protected String algorithm; @XmlAttribute diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java index 86a529f1a7f8d..3b22d6785f78a 100644 --- a/core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java @@ -394,7 +394,7 @@ public void testAnotherGetProperty() throws Exception { @Test public void testGetPropertyLocaleIndependent() throws Exception { Locale oldLocale = Locale.getDefault(); - Locale.setDefault(new Locale("tr", "TR")); + Locale.setDefault(Locale.of("tr", "TR")); try { ExampleBean bean = new ExampleBean(); diff --git a/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersNamedGroupsListTest.java b/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersNamedGroupsListTest.java index d5a67af1f8ede..51b8ba8043fe4 100644 --- a/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersNamedGroupsListTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersNamedGroupsListTest.java @@ -16,17 +16,13 @@ */ package org.apache.camel.support.jsse; -import java.lang.reflect.Method; import java.util.List; import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLParameters; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledForJreRange; -import org.junit.jupiter.api.condition.JRE; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.assertj.core.api.Assertions.assertThat; /** * Blank, duplicate and not trimmed values in the named groups and signature schemes lists must not make the configured @@ -34,13 +30,7 @@ */ public class SSLContextParametersNamedGroupsListTest { - private static List get(SSLParameters params, String name) throws Exception { - Method method = SSLParameters.class.getMethod(name); - return List.of((String[]) method.invoke(params)); - } - @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testNamedGroups() throws Exception { NamedGroupsParameters ngp = new NamedGroupsParameters(); ngp.setNamedGroup(List.of("secp384r1", "secp384r1", "", " x25519")); @@ -48,11 +38,11 @@ public void testNamedGroups() throws Exception { scp.setNamedGroups(ngp); SSLEngine engine = scp.createSSLContext(null).createSSLEngine(); - assertEquals(List.of("secp384r1", "x25519"), get(engine.getSSLParameters(), "getNamedGroups")); + assertThat(List.of(engine.getSSLParameters().getNamedGroups())) + .containsExactly("secp384r1", "x25519"); } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testSignatureSchemes() throws Exception { SignatureSchemesParameters ssp = new SignatureSchemesParameters(); ssp.setSignatureScheme(List.of("ecdsa_secp256r1_sha256", " ecdsa_secp256r1_sha256", "", "rsa_pss_rsae_sha256")); @@ -60,7 +50,7 @@ public void testSignatureSchemes() throws Exception { scp.setSignatureSchemes(ssp); SSLEngine engine = scp.createSSLContext(null).createSSLEngine(); - assertEquals(List.of("ecdsa_secp256r1_sha256", "rsa_pss_rsae_sha256"), - get(engine.getSSLParameters(), "getSignatureSchemes")); + assertThat(List.of(engine.getSSLParameters().getSignatureSchemes())) + .containsExactly("ecdsa_secp256r1_sha256", "rsa_pss_rsae_sha256"); } } diff --git a/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java b/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java index 80053adead2fe..2d681a45b3c8e 100644 --- a/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/support/jsse/SSLContextParametersTest.java @@ -16,7 +16,6 @@ */ package org.apache.camel.support.jsse; -import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -26,7 +25,6 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLSocket; @@ -746,12 +744,11 @@ public void testSecureSocketProtocolsFilter() throws Exception { } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testNamedGroups() throws Exception { SSLContext controlContext = SSLContext.getInstance("TLSv1.3"); controlContext.init(null, null, null); SSLEngine controlEngine = controlContext.createSSLEngine(); - String[] controlNamedGroups = getNamedGroups(controlEngine.getSSLParameters()); + String[] controlNamedGroups = controlEngine.getSSLParameters().getNamedGroups(); // default - no named groups configured // When PQC groups are available (JDK 25+), auto-configuration reorders named groups @@ -764,14 +761,14 @@ public void testNamedGroups() throws Exception { if (Arrays.asList(controlNamedGroups).contains("X25519MLKEM768")) { // PQC auto-configuration reorders groups with X25519MLKEM768 first - assertEquals("X25519MLKEM768", getNamedGroups(engine.getSSLParameters())[0]); - assertEquals("X25519MLKEM768", getNamedGroups(socket.getSSLParameters())[0]); - assertEquals("X25519MLKEM768", getNamedGroups(serverSocket.getSSLParameters())[0]); + assertEquals("X25519MLKEM768", engine.getSSLParameters().getNamedGroups()[0]); + assertEquals("X25519MLKEM768", socket.getSSLParameters().getNamedGroups()[0]); + assertEquals("X25519MLKEM768", serverSocket.getSSLParameters().getNamedGroups()[0]); } else { // No PQC available, should keep JVM defaults - assertArrayEquals(controlNamedGroups, getNamedGroups(engine.getSSLParameters())); - assertArrayEquals(controlNamedGroups, getNamedGroups(socket.getSSLParameters())); - assertArrayEquals(controlNamedGroups, getNamedGroups(serverSocket.getSSLParameters())); + assertArrayEquals(controlNamedGroups, engine.getSSLParameters().getNamedGroups()); + assertArrayEquals(controlNamedGroups, socket.getSSLParameters().getNamedGroups()); + assertArrayEquals(controlNamedGroups, serverSocket.getSSLParameters().getNamedGroups()); } // empty ngp - sets empty list @@ -782,9 +779,9 @@ public void testNamedGroups() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(0, getNamedGroups(engine.getSSLParameters()).length); - assertEquals(0, getNamedGroups(socket.getSSLParameters()).length); - assertEquals(0, getNamedGroups(serverSocket.getSSLParameters()).length); + assertEquals(0, engine.getSSLParameters().getNamedGroups().length); + assertEquals(0, socket.getSSLParameters().getNamedGroups().length); + assertEquals(0, serverSocket.getSSLParameters().getNamedGroups().length); // explicit named group ngp.setNamedGroup(Collections.singletonList(controlNamedGroups[0])); @@ -793,12 +790,12 @@ public void testNamedGroups() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(1, getNamedGroups(engine.getSSLParameters()).length); - assertEquals(controlNamedGroups[0], getNamedGroups(engine.getSSLParameters())[0]); - assertEquals(1, getNamedGroups(socket.getSSLParameters()).length); - assertEquals(controlNamedGroups[0], getNamedGroups(socket.getSSLParameters())[0]); - assertEquals(1, getNamedGroups(serverSocket.getSSLParameters()).length); - assertEquals(controlNamedGroups[0], getNamedGroups(serverSocket.getSSLParameters())[0]); + assertEquals(1, engine.getSSLParameters().getNamedGroups().length); + assertEquals(controlNamedGroups[0], engine.getSSLParameters().getNamedGroups()[0]); + assertEquals(1, socket.getSSLParameters().getNamedGroups().length); + assertEquals(controlNamedGroups[0], socket.getSSLParameters().getNamedGroups()[0]); + assertEquals(1, serverSocket.getSSLParameters().getNamedGroups().length); + assertEquals(controlNamedGroups[0], serverSocket.getSSLParameters().getNamedGroups()[0]); // explicit named groups override filter FilterParameters filter = new FilterParameters(); @@ -809,21 +806,20 @@ public void testNamedGroups() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(1, getNamedGroups(engine.getSSLParameters()).length); - assertEquals(controlNamedGroups[0], getNamedGroups(engine.getSSLParameters())[0]); - assertEquals(1, getNamedGroups(socket.getSSLParameters()).length); - assertEquals(controlNamedGroups[0], getNamedGroups(socket.getSSLParameters())[0]); - assertEquals(1, getNamedGroups(serverSocket.getSSLParameters()).length); - assertEquals(controlNamedGroups[0], getNamedGroups(serverSocket.getSSLParameters())[0]); + assertEquals(1, engine.getSSLParameters().getNamedGroups().length); + assertEquals(controlNamedGroups[0], engine.getSSLParameters().getNamedGroups()[0]); + assertEquals(1, socket.getSSLParameters().getNamedGroups().length); + assertEquals(controlNamedGroups[0], socket.getSSLParameters().getNamedGroups()[0]); + assertEquals(1, serverSocket.getSSLParameters().getNamedGroups().length); + assertEquals(controlNamedGroups[0], serverSocket.getSSLParameters().getNamedGroups()[0]); } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testNamedGroupsFilter() throws Exception { SSLContext controlContext = SSLContext.getInstance("TLSv1.3"); controlContext.init(null, null, null); SSLEngine controlEngine = controlContext.createSSLEngine(); - String[] controlNamedGroups = getNamedGroups(controlEngine.getSSLParameters()); + String[] controlNamedGroups = controlEngine.getSSLParameters().getNamedGroups(); // default - no filter, keeps defaults (or PQC-reordered defaults on JDK 25+) SSLContextParameters scp = new SSLContextParameters(); @@ -834,13 +830,13 @@ public void testNamedGroupsFilter() throws Exception { SSLServerSocket serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); if (Arrays.asList(controlNamedGroups).contains("X25519MLKEM768")) { - assertEquals("X25519MLKEM768", getNamedGroups(engine.getSSLParameters())[0]); - assertEquals("X25519MLKEM768", getNamedGroups(socket.getSSLParameters())[0]); - assertEquals("X25519MLKEM768", getNamedGroups(serverSocket.getSSLParameters())[0]); + assertEquals("X25519MLKEM768", engine.getSSLParameters().getNamedGroups()[0]); + assertEquals("X25519MLKEM768", socket.getSSLParameters().getNamedGroups()[0]); + assertEquals("X25519MLKEM768", serverSocket.getSSLParameters().getNamedGroups()[0]); } else { - assertArrayEquals(controlNamedGroups, getNamedGroups(engine.getSSLParameters())); - assertArrayEquals(controlNamedGroups, getNamedGroups(socket.getSSLParameters())); - assertArrayEquals(controlNamedGroups, getNamedGroups(serverSocket.getSSLParameters())); + assertArrayEquals(controlNamedGroups, engine.getSSLParameters().getNamedGroups()); + assertArrayEquals(controlNamedGroups, socket.getSSLParameters().getNamedGroups()); + assertArrayEquals(controlNamedGroups, serverSocket.getSSLParameters().getNamedGroups()); } // empty filter - no includes means no groups match @@ -851,9 +847,9 @@ public void testNamedGroupsFilter() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(0, getNamedGroups(engine.getSSLParameters()).length); - assertEquals(0, getNamedGroups(socket.getSSLParameters()).length); - assertEquals(0, getNamedGroups(serverSocket.getSSLParameters()).length); + assertEquals(0, engine.getSSLParameters().getNamedGroups().length); + assertEquals(0, socket.getSSLParameters().getNamedGroups().length); + assertEquals(0, serverSocket.getSSLParameters().getNamedGroups().length); // include all filter.getInclude().add(".*"); @@ -862,9 +858,9 @@ public void testNamedGroupsFilter() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertArrayEquals(controlNamedGroups, getNamedGroups(engine.getSSLParameters())); - assertArrayEquals(controlNamedGroups, getNamedGroups(socket.getSSLParameters())); - assertArrayEquals(controlNamedGroups, getNamedGroups(serverSocket.getSSLParameters())); + assertArrayEquals(controlNamedGroups, engine.getSSLParameters().getNamedGroups()); + assertArrayEquals(controlNamedGroups, socket.getSSLParameters().getNamedGroups()); + assertArrayEquals(controlNamedGroups, serverSocket.getSSLParameters().getNamedGroups()); // include all but exclude all (excludes win) filter.getExclude().add(".*"); @@ -873,9 +869,9 @@ public void testNamedGroupsFilter() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(0, getNamedGroups(engine.getSSLParameters()).length); - assertEquals(0, getNamedGroups(socket.getSSLParameters()).length); - assertEquals(0, getNamedGroups(serverSocket.getSSLParameters()).length); + assertEquals(0, engine.getSSLParameters().getNamedGroups().length); + assertEquals(0, socket.getSSLParameters().getNamedGroups().length); + assertEquals(0, serverSocket.getSSLParameters().getNamedGroups().length); // include only x* groups (e.g. x25519, x448) filter.getInclude().clear(); @@ -886,22 +882,21 @@ public void testNamedGroupsFilter() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertTrue(getNamedGroups(engine.getSSLParameters()).length >= 1); - for (String group : getNamedGroups(engine.getSSLParameters())) { + assertTrue(engine.getSSLParameters().getNamedGroups().length >= 1); + for (String group : engine.getSSLParameters().getNamedGroups()) { assertTrue(group.startsWith("x"), "Expected group starting with 'x' but got: " + group); } - assertTrue(getNamedGroups(socket.getSSLParameters()).length >= 1); - for (String group : getNamedGroups(socket.getSSLParameters())) { + assertTrue(socket.getSSLParameters().getNamedGroups().length >= 1); + for (String group : socket.getSSLParameters().getNamedGroups()) { assertTrue(group.startsWith("x"), "Expected group starting with 'x' but got: " + group); } - assertTrue(getNamedGroups(serverSocket.getSSLParameters()).length >= 1); - for (String group : getNamedGroups(serverSocket.getSSLParameters())) { + assertTrue(serverSocket.getSSLParameters().getNamedGroups().length >= 1); + for (String group : serverSocket.getSSLParameters().getNamedGroups()) { assertTrue(group.startsWith("x"), "Expected group starting with 'x' but got: " + group); } } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testNamedGroupsDoNotAffectCipherSuitesOrProtocols() throws Exception { SSLContext controlContext = SSLContext.getInstance("TLSv1.3"); controlContext.init(null, null, null); @@ -918,17 +913,16 @@ public void testNamedGroupsDoNotAffectCipherSuitesOrProtocols() throws Exception assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()); assertArrayEquals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()); - assertEquals(1, getNamedGroups(engine.getSSLParameters()).length); - assertEquals("x25519", getNamedGroups(engine.getSSLParameters())[0]); + assertEquals(1, engine.getSSLParameters().getNamedGroups().length); + assertEquals("x25519", engine.getSSLParameters().getNamedGroups()[0]); } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testSignatureSchemes() throws Exception { SSLContext controlContext = SSLContext.getInstance("TLSv1.3"); controlContext.init(null, null, null); SSLEngine controlEngine = controlContext.createSSLEngine(); - String[] controlSignatureSchemes = getSignatureSchemes(controlEngine.getSSLParameters()); + String[] controlSignatureSchemes = controlEngine.getSSLParameters().getSignatureSchemes(); // default - no signature schemes configured, should keep defaults SSLContextParameters scp = new SSLContextParameters(); @@ -938,9 +932,9 @@ public void testSignatureSchemes() throws Exception { SSLSocket socket = (SSLSocket) context.getSocketFactory().createSocket(); SSLServerSocket serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertArrayEquals(controlSignatureSchemes, getSignatureSchemes(engine.getSSLParameters())); - assertArrayEquals(controlSignatureSchemes, getSignatureSchemes(socket.getSSLParameters())); - assertArrayEquals(controlSignatureSchemes, getSignatureSchemes(serverSocket.getSSLParameters())); + assertArrayEquals(controlSignatureSchemes, engine.getSSLParameters().getSignatureSchemes()); + assertArrayEquals(controlSignatureSchemes, socket.getSSLParameters().getSignatureSchemes()); + assertArrayEquals(controlSignatureSchemes, serverSocket.getSSLParameters().getSignatureSchemes()); // empty ssp - sets empty list SignatureSchemesParameters ssp = new SignatureSchemesParameters(); @@ -950,9 +944,9 @@ public void testSignatureSchemes() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(0, getSignatureSchemes(engine.getSSLParameters()).length); - assertEquals(0, getSignatureSchemes(socket.getSSLParameters()).length); - assertEquals(0, getSignatureSchemes(serverSocket.getSSLParameters()).length); + assertEquals(0, engine.getSSLParameters().getSignatureSchemes().length); + assertEquals(0, socket.getSSLParameters().getSignatureSchemes().length); + assertEquals(0, serverSocket.getSSLParameters().getSignatureSchemes().length); // explicit signature scheme ssp.setSignatureScheme(Collections.singletonList("rsa_pss_rsae_sha256")); @@ -961,12 +955,12 @@ public void testSignatureSchemes() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(1, getSignatureSchemes(engine.getSSLParameters()).length); - assertEquals("rsa_pss_rsae_sha256", getSignatureSchemes(engine.getSSLParameters())[0]); - assertEquals(1, getSignatureSchemes(socket.getSSLParameters()).length); - assertEquals("rsa_pss_rsae_sha256", getSignatureSchemes(socket.getSSLParameters())[0]); - assertEquals(1, getSignatureSchemes(serverSocket.getSSLParameters()).length); - assertEquals("rsa_pss_rsae_sha256", getSignatureSchemes(serverSocket.getSSLParameters())[0]); + assertEquals(1, engine.getSSLParameters().getSignatureSchemes().length); + assertEquals("rsa_pss_rsae_sha256", engine.getSSLParameters().getSignatureSchemes()[0]); + assertEquals(1, socket.getSSLParameters().getSignatureSchemes().length); + assertEquals("rsa_pss_rsae_sha256", socket.getSSLParameters().getSignatureSchemes()[0]); + assertEquals(1, serverSocket.getSSLParameters().getSignatureSchemes().length); + assertEquals("rsa_pss_rsae_sha256", serverSocket.getSSLParameters().getSignatureSchemes()[0]); // explicit signature schemes override filter FilterParameters filter = new FilterParameters(); @@ -977,16 +971,16 @@ public void testSignatureSchemes() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(1, getSignatureSchemes(engine.getSSLParameters()).length); - assertEquals("rsa_pss_rsae_sha256", getSignatureSchemes(engine.getSSLParameters())[0]); - assertEquals(1, getSignatureSchemes(socket.getSSLParameters()).length); - assertEquals("rsa_pss_rsae_sha256", getSignatureSchemes(socket.getSSLParameters())[0]); - assertEquals(1, getSignatureSchemes(serverSocket.getSSLParameters()).length); - assertEquals("rsa_pss_rsae_sha256", getSignatureSchemes(serverSocket.getSSLParameters())[0]); + assertEquals(1, engine.getSSLParameters().getSignatureSchemes().length); + assertEquals("rsa_pss_rsae_sha256", engine.getSSLParameters().getSignatureSchemes()[0]); + assertEquals(1, socket.getSSLParameters().getSignatureSchemes().length); + assertEquals("rsa_pss_rsae_sha256", socket.getSSLParameters().getSignatureSchemes()[0]); + assertEquals(1, serverSocket.getSSLParameters().getSignatureSchemes().length); + assertEquals("rsa_pss_rsae_sha256", serverSocket.getSSLParameters().getSignatureSchemes()[0]); } @Test - @EnabledForJreRange(min = JRE.JAVA_21, max = JRE.JAVA_25) + @EnabledForJreRange(max = JRE.JAVA_25) public void testSignatureSchemesFilter() throws Exception { // Note: SSLParameters.getSignatureSchemes() returns null by default (unlike getNamedGroups()), // so filters operate on explicitly provided schemes rather than JDK defaults. @@ -999,9 +993,9 @@ public void testSignatureSchemesFilter() throws Exception { SSLSocket socket = (SSLSocket) context.getSocketFactory().createSocket(); SSLServerSocket serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertNull(getSignatureSchemes(engine.getSSLParameters())); - assertNull(getSignatureSchemes(socket.getSSLParameters())); - assertNull(getSignatureSchemes(serverSocket.getSSLParameters())); + assertNull(engine.getSSLParameters().getSignatureSchemes()); + assertNull(socket.getSSLParameters().getSignatureSchemes()); + assertNull(serverSocket.getSSLParameters().getSignatureSchemes()); // a filter cannot be applied as there are no default schemes to filter, so the defaults are kept (null) // instead of an empty list (which would fail every handshake) @@ -1013,9 +1007,9 @@ public void testSignatureSchemesFilter() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertNull(getSignatureSchemes(engine.getSSLParameters())); - assertNull(getSignatureSchemes(socket.getSSLParameters())); - assertNull(getSignatureSchemes(serverSocket.getSSLParameters())); + assertNull(engine.getSSLParameters().getSignatureSchemes()); + assertNull(socket.getSSLParameters().getSignatureSchemes()); + assertNull(serverSocket.getSSLParameters().getSignatureSchemes()); filter.getInclude().clear(); // explicit schemes override filter - filter ignored when schemes are set @@ -1033,7 +1027,7 @@ public void testSignatureSchemesFilter() throws Exception { engine = context.createSSLEngine(); // explicit schemes take precedence over filter - assertEquals(4, getSignatureSchemes(engine.getSSLParameters()).length); + assertEquals(4, engine.getSSLParameters().getSignatureSchemes().length); // clear explicit schemes, keep filter scp.setSignatureSchemes(null); @@ -1045,9 +1039,9 @@ public void testSignatureSchemesFilter() throws Exception { serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); // JDK defaults are null → the filter cannot be applied and the defaults are kept (not an empty array) - assertNull(getSignatureSchemes(engine.getSSLParameters())); - assertNull(getSignatureSchemes(socket.getSSLParameters())); - assertNull(getSignatureSchemes(serverSocket.getSSLParameters())); + assertNull(engine.getSSLParameters().getSignatureSchemes()); + assertNull(socket.getSSLParameters().getSignatureSchemes()); + assertNull(serverSocket.getSSLParameters().getSignatureSchemes()); } @Test @@ -1063,11 +1057,11 @@ public void testSignatureSchemesFilter_postJDK26() throws Exception { SSLSocket socket = (SSLSocket) context.getSocketFactory().createSocket(); SSLServerSocket serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertNotNull(getSignatureSchemes(engine.getSSLParameters())); - assertNotNull(getSignatureSchemes(socket.getSSLParameters())); - assertNotNull(getSignatureSchemes(serverSocket.getSSLParameters())); + assertNotNull(engine.getSSLParameters().getSignatureSchemes()); + assertNotNull(socket.getSSLParameters().getSignatureSchemes()); + assertNotNull(serverSocket.getSSLParameters().getSignatureSchemes()); - int defaultSignatureSchemeNumber = getSignatureSchemes(engine.getSSLParameters()).length; + int defaultSignatureSchemeNumber = engine.getSSLParameters().getSignatureSchemes().length; // a filter cannot be applied as there are no default schemes to filter, so the defaults are kept (null) // instead of an empty list (which would fail every handshake) @@ -1079,9 +1073,9 @@ public void testSignatureSchemesFilter_postJDK26() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertNull(getSignatureSchemes(engine.getSSLParameters())); - assertNull(getSignatureSchemes(socket.getSSLParameters())); - assertNull(getSignatureSchemes(serverSocket.getSSLParameters())); + assertNull(engine.getSSLParameters().getSignatureSchemes()); + assertNull(socket.getSSLParameters().getSignatureSchemes()); + assertNull(serverSocket.getSSLParameters().getSignatureSchemes()); filter.getInclude().clear(); // explicit schemes override filter - filter ignored when schemes are set @@ -1099,7 +1093,7 @@ public void testSignatureSchemesFilter_postJDK26() throws Exception { engine = context.createSSLEngine(); // explicit schemes take precedence over filter - assertEquals(4, getSignatureSchemes(engine.getSSLParameters()).length); + assertEquals(4, engine.getSSLParameters().getSignatureSchemes().length); // clear explicit schemes, keep filter - now filter applies to JDK defaults scp.setSignatureSchemes(null); @@ -1110,13 +1104,12 @@ public void testSignatureSchemesFilter_postJDK26() throws Exception { socket = (SSLSocket) context.getSocketFactory().createSocket(); serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket(); - assertEquals(defaultSignatureSchemeNumber, getSignatureSchemes(engine.getSSLParameters()).length); - assertEquals(defaultSignatureSchemeNumber, getSignatureSchemes(socket.getSSLParameters()).length); - assertEquals(defaultSignatureSchemeNumber, getSignatureSchemes(serverSocket.getSSLParameters()).length); + assertEquals(defaultSignatureSchemeNumber, engine.getSSLParameters().getSignatureSchemes().length); + assertEquals(defaultSignatureSchemeNumber, socket.getSSLParameters().getSignatureSchemes().length); + assertEquals(defaultSignatureSchemeNumber, serverSocket.getSSLParameters().getSignatureSchemes().length); } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testSignatureSchemesDoNotAffectOtherSettings() throws Exception { SSLContext controlContext = SSLContext.getInstance("TLSv1.3"); controlContext.init(null, null, null); @@ -1134,16 +1127,16 @@ public void testSignatureSchemesDoNotAffectOtherSettings() throws Exception { assertArrayEquals(controlEngine.getEnabledCipherSuites(), engine.getEnabledCipherSuites()); assertArrayEquals(controlEngine.getEnabledProtocols(), engine.getEnabledProtocols()); // Named groups may be reordered by PQC auto-configuration, but same groups should be present - String[] controlGroups = getNamedGroups(controlEngine.getSSLParameters()); - String[] engineGroups = getNamedGroups(engine.getSSLParameters()); + String[] controlGroups = controlEngine.getSSLParameters().getNamedGroups(); + String[] engineGroups = engine.getSSLParameters().getNamedGroups(); if (controlGroups != null && Arrays.asList(controlGroups).contains("X25519MLKEM768")) { assertEquals("X25519MLKEM768", engineGroups[0]); assertEquals(controlGroups.length, engineGroups.length); } else { assertArrayEquals(controlGroups, engineGroups); } - assertEquals(1, getSignatureSchemes(engine.getSSLParameters()).length); - assertEquals("rsa_pss_rsae_sha256", getSignatureSchemes(engine.getSSLParameters())[0]); + assertEquals(1, engine.getSSLParameters().getSignatureSchemes().length); + assertEquals("rsa_pss_rsae_sha256", engine.getSSLParameters().getSignatureSchemes()[0]); } @Test @@ -1232,19 +1225,18 @@ public void testProvider() throws Exception { } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testPqcNamedGroupsAutoConfigured() throws Exception { SSLContext controlContext = SSLContext.getInstance("TLSv1.3"); controlContext.init(null, null, null); SSLEngine controlEngine = controlContext.createSSLEngine(); - String[] controlNamedGroups = getNamedGroups(controlEngine.getSSLParameters()); + String[] controlNamedGroups = controlEngine.getSSLParameters().getNamedGroups(); boolean pqcAvailable = controlNamedGroups != null && Arrays.asList(controlNamedGroups).contains("X25519MLKEM768"); SSLContextParameters scp = new SSLContextParameters(); SSLContext context = scp.createSSLContext(null); SSLEngine engine = context.createSSLEngine(); - String[] resultGroups = getNamedGroups(engine.getSSLParameters()); + String[] resultGroups = engine.getSSLParameters().getNamedGroups(); if (pqcAvailable) { // X25519MLKEM768 should be first @@ -1261,7 +1253,6 @@ public void testPqcNamedGroupsAutoConfigured() throws Exception { } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testPqcNamedGroupsUserConfigOverrides() throws Exception { // User-configured named groups should NOT be overridden by PQC auto-config SSLContextParameters scp = new SSLContextParameters(); @@ -1272,12 +1263,11 @@ public void testPqcNamedGroupsUserConfigOverrides() throws Exception { SSLContext context = scp.createSSLContext(null); SSLEngine engine = context.createSSLEngine(); - assertEquals(1, getNamedGroups(engine.getSSLParameters()).length); - assertEquals("secp256r1", getNamedGroups(engine.getSSLParameters())[0]); + assertEquals(1, engine.getSSLParameters().getNamedGroups().length); + assertEquals("secp256r1", engine.getSSLParameters().getNamedGroups()[0]); } @Test - @EnabledForJreRange(min = JRE.JAVA_21) public void testPqcNamedGroupsFilterOverrides() throws Exception { // User-configured named groups filter should NOT be overridden by PQC auto-config SSLContextParameters scp = new SSLContextParameters(); @@ -1288,7 +1278,7 @@ public void testPqcNamedGroupsFilterOverrides() throws Exception { SSLContext context = scp.createSSLContext(null); SSLEngine engine = context.createSSLEngine(); - for (String group : getNamedGroups(engine.getSSLParameters())) { + for (String group : engine.getSSLParameters().getNamedGroups()) { assertTrue(group.startsWith("secp"), "Expected group starting with 'secp' but got: " + group); } } @@ -1330,15 +1320,4 @@ protected void assertStartsWith(Collection values, String prefix) { } } - // Reflection helpers for JDK 20+ SSLParameters.getNamedGroups()/getSignatureSchemes() - // These methods are not available with --release 17 compilation target - private static String[] getNamedGroups(SSLParameters params) throws Exception { - Method m = SSLParameters.class.getMethod("getNamedGroups"); - return (String[]) m.invoke(params); - } - - private static String[] getSignatureSchemes(SSLParameters params) throws Exception { - Method m = SSLParameters.class.getMethod("getSignatureSchemes"); - return (String[]) m.invoke(params); - } } diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json index cd2101ee33b79..ddd3fcbbdbe87 100644 --- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json +++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json @@ -474,19 +474,19 @@ { "name": "camel.ssl.cipherSuitesInclude", "required": false, "description": "Filters TLS\/SSL cipher suites algorithms names. This filter is used for including algorithms that matches the naming pattern. Multiple names can be separated by comma. Notice that if the cipherSuites option has been configured then the include\/exclude filters are not in use.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.clientAuthentication", "required": false, "description": "Sets the configuration for server-side client-authentication requirements", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "enum", "javaType": "java.lang.String", "defaultValue": "NONE", "secret": false, "enum": [ "NONE", "WANT", "REQUIRE" ] }, { "name": "camel.ssl.enabled", "required": false, "description": "Enables SSL in your Camel application.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": false }, - { "name": "camel.ssl.keyManagerAlgorithm", "required": false, "description": "Algorithm name used for creating the KeyManagerFactory. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, + { "name": "camel.ssl.keyManagerAlgorithm", "required": false, "description": "Algorithm name used for creating the KeyManagerFactory. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.keyManagerProvider", "required": false, "description": "To use a specific provider for creating KeyManagerFactory. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.keyStore", "required": false, "description": "The key store to load. The key store is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development).", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.keystorePassword", "required": false, "description": "Sets the SSL Keystore password.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": true, "security": "secret" }, { "name": "camel.ssl.keyStoreProvider", "required": false, "description": "To use a specific provider for creating KeyStore. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, - { "name": "camel.ssl.keyStoreType", "required": false, "description": "The type of the key store to load. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, + { "name": "camel.ssl.keyStoreType", "required": false, "description": "The type of the key store to load. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.namedGroups", "required": false, "description": "List of TLS\/SSL named groups (key exchange groups). Multiple names can be separated by comma. Named groups control which key exchange algorithms are available during the TLS handshake, including post-quantum hybrid groups such as X25519MLKEM768.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.namedGroupsExclude", "required": false, "description": "Filters TLS\/SSL named groups. This filter is used for excluding named groups that match the naming pattern. Multiple names can be separated by comma. Notice that if the namedGroups option has been configured then the include\/exclude filters are not in use.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.namedGroupsInclude", "required": false, "description": "Filters TLS\/SSL named groups. This filter is used for including named groups that match the naming pattern. Multiple names can be separated by comma. Notice that if the namedGroups option has been configured then the include\/exclude filters are not in use.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.provider", "required": false, "description": "To use a specific provider for creating SSLContext. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, - { "name": "camel.ssl.secureRandomAlgorithm", "required": false, "description": "Algorithm name used for creating the SecureRandom. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, + { "name": "camel.ssl.secureRandomAlgorithm", "required": false, "description": "Algorithm name used for creating the SecureRandom. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, { "name": "camel.ssl.secureRandomProvider", "required": false, "description": "To use a specific provider for creating SecureRandom. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "secret": false }, - { "name": "camel.ssl.secureSocketProtocol", "required": false, "description": "The protocol for the secure sockets created by the SSLContext. See https:\/\/docs.oracle.com\/en\/java\/javase\/17\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "TLSv1.3", "secret": false }, + { "name": "camel.ssl.secureSocketProtocol", "required": false, "description": "The protocol for the secure sockets created by the SSLContext. See https:\/\/docs.oracle.com\/en\/java\/javase\/21\/docs\/specs\/security\/standard-names.html", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "TLSv1.3", "secret": false }, { "name": "camel.ssl.selfSigned", "required": false, "description": "Whether to generate a self-signed certificate for development use when no keystore is configured. This can be used in development environment to easily enable HTTPS without providing a keystore. Do NOT use this in production as the certificate is not trusted and is regenerated on each restart.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": false, "secret": false }, { "name": "camel.ssl.selfSignedKeyType", "required": false, "description": "The key algorithm to use when generating the self-signed certificate for development use (requires selfSigned to be enabled). Supported values are EC (default, NIST P-256) and RSA (2048-bit).", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "enum", "javaType": "java.lang.String", "defaultValue": "EC", "secret": false, "enum": [ "EC", "RSA" ] }, { "name": "camel.ssl.sessionTimeout", "required": false, "description": "Timeout in seconds to use for SSLContext. The default is 24 hours.", "sourceType": "org.apache.camel.main.SSLConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 86400, "secret": false }, diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc index a780e2eabb675..75306c4f9e1f1 100644 --- a/core/camel-main/src/main/docs/main.adoc +++ b/core/camel-main/src/main/docs/main.adoc @@ -356,19 +356,19 @@ The camel.ssl supports 28 options, which are listed below. | `camel.ssl.cipherSuitesInclude` | Filters TLS/SSL cipher suites algorithms names. This filter is used for including algorithms that matches the naming pattern. Multiple names can be separated by comma. Notice that if the cipherSuites option has been configured then the include/exclude filters are not in use. | | String | `camel.ssl.clientAuthentication` | Sets the configuration for server-side client-authentication requirements | NONE | String | `camel.ssl.enabled` | Enables SSL in your Camel application. | false | boolean -| `camel.ssl.keyManagerAlgorithm` | Algorithm name used for creating the KeyManagerFactory. See \https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html | | String +| `camel.ssl.keyManagerAlgorithm` | Algorithm name used for creating the KeyManagerFactory. See \https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html | | String | `camel.ssl.keyManagerProvider` | To use a specific provider for creating KeyManagerFactory. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol. | | String | `camel.ssl.keyStore` | The key store to load. The key store is by default loaded from classpath. If you must load from file system, then use file: as prefix. file:nameOfFile (to refer to the file system) classpath:nameOfFile (to refer to the classpath; default) http:uri (to load the resource using HTTP) ref:nameOfBean (to lookup an existing KeyStore instance from the registry, for example for testing and development). | | String | `camel.ssl.keystorePassword` | Sets the SSL Keystore password. | | String | `camel.ssl.keyStoreProvider` | To use a specific provider for creating KeyStore. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol. | | String -| `camel.ssl.keyStoreType` | The type of the key store to load. See \https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html | | String +| `camel.ssl.keyStoreType` | The type of the key store to load. See \https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html | | String | `camel.ssl.namedGroups` | List of TLS/SSL named groups (key exchange groups). Multiple names can be separated by comma. Named groups control which key exchange algorithms are available during the TLS handshake, including post-quantum hybrid groups such as X25519MLKEM768. | | String | `camel.ssl.namedGroupsExclude` | Filters TLS/SSL named groups. This filter is used for excluding named groups that match the naming pattern. Multiple names can be separated by comma. Notice that if the namedGroups option has been configured then the include/exclude filters are not in use. | | String | `camel.ssl.namedGroupsInclude` | Filters TLS/SSL named groups. This filter is used for including named groups that match the naming pattern. Multiple names can be separated by comma. Notice that if the namedGroups option has been configured then the include/exclude filters are not in use. | | String | `camel.ssl.provider` | To use a specific provider for creating SSLContext. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol. | | String -| `camel.ssl.secureRandomAlgorithm` | Algorithm name used for creating the SecureRandom. See \https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html | | String +| `camel.ssl.secureRandomAlgorithm` | Algorithm name used for creating the SecureRandom. See \https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html | | String | `camel.ssl.secureRandomProvider` | To use a specific provider for creating SecureRandom. The list of available providers returned by java.security.Security.getProviders() or null to use the highest priority provider implementing the secure socket protocol. | | String -| `camel.ssl.secureSocketProtocol` | The protocol for the secure sockets created by the SSLContext. See \https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html | TLSv1.3 | String +| `camel.ssl.secureSocketProtocol` | The protocol for the secure sockets created by the SSLContext. See \https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html | TLSv1.3 | String | `camel.ssl.selfSigned` | Whether to generate a self-signed certificate for development use when no keystore is configured. This can be used in development environment to easily enable HTTPS without providing a keystore. Do NOT use this in production as the certificate is not trusted and is regenerated on each restart. | false | boolean | `camel.ssl.selfSignedKeyType` | The key algorithm to use when generating the self-signed certificate for development use (requires selfSigned to be enabled). Supported values are EC (default, NIST P-256) and RSA (2048-bit). | EC | String | `camel.ssl.sessionTimeout` | Timeout in seconds to use for SSLContext. The default is 24 hours. | 86400 | int diff --git a/core/camel-main/src/main/java/org/apache/camel/main/SSLConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/SSLConfigurationProperties.java index 24ace35c44416..1b62137a90106 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/SSLConfigurationProperties.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/SSLConfigurationProperties.java @@ -130,7 +130,7 @@ public String getSecureSocketProtocol() { /** * The protocol for the secure sockets created by the SSLContext. *

- * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public void setSecureSocketProtocol(String secureSocketProtocol) { this.secureSocketProtocol = secureSocketProtocol; @@ -317,7 +317,7 @@ public String getKeyStoreType() { /** * The type of the key store to load. *

- * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public void setKeyStoreType(String keyStoreType) { this.keyStoreType = keyStoreType; @@ -422,7 +422,7 @@ public String getKeyManagerAlgorithm() { /** * Algorithm name used for creating the KeyManagerFactory. *

- * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public void setKeyManagerAlgorithm(String keyManagerAlgorithm) { this.keyManagerAlgorithm = keyManagerAlgorithm; @@ -449,7 +449,7 @@ public String getSecureRandomAlgorithm() { /** * Algorithm name used for creating the SecureRandom. *

- * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public void setSecureRandomAlgorithm(String secureRandomAlgorithm) { this.secureRandomAlgorithm = secureRandomAlgorithm; @@ -502,7 +502,7 @@ public SSLConfigurationProperties withProvider(String provider) { /** * The optional protocol for the secure sockets created by the SSLContext. *

- * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public SSLConfigurationProperties withSecureSocketProtocol(String secureSocketProtocol) { this.secureSocketProtocol = secureSocketProtocol; @@ -650,7 +650,7 @@ public SSLConfigurationProperties withKeyStore(String keyStore) { /** * The type of the key store to load. *

- * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public SSLConfigurationProperties withKeyStoreType(String keyStoreType) { this.keyStoreType = keyStoreType; @@ -731,7 +731,7 @@ public SSLConfigurationProperties withSelfSignedKeyType(String selfSignedKeyType /** * Algorithm name used for creating the KeyManagerFactory. *

- * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public SSLConfigurationProperties withKeyManagerAlgorithm(String keyManagerAlgorithm) { this.keyManagerAlgorithm = keyManagerAlgorithm; @@ -752,7 +752,7 @@ public SSLConfigurationProperties withKeyManagerProvider(String keyManagerProvid /** * Algorithm name used for creating the SecureRandom. *

- * See https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html + * See https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html */ public SSLConfigurationProperties withSecureRandomAlgorithm(String secureRandomAlgorithm) { this.secureRandomAlgorithm = secureRandomAlgorithm; diff --git a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedAsyncProcessorAwaitManager.java b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedAsyncProcessorAwaitManager.java index a209b900e1e8c..7beddc6769e24 100644 --- a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedAsyncProcessorAwaitManager.java +++ b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedAsyncProcessorAwaitManager.java @@ -82,9 +82,7 @@ public TabularData browse() { private static CompositeData toCompositeData(AsyncProcessorAwaitManager.AwaitThread entry, CompositeType ct) throws OpenDataException { - // TODO Update once baseline is Java 21 - // String id = Long.toString(entry.getBlockedThread().threadId()); - String id = Long.toString(entry.getBlockedThread().getId()); + String id = Long.toString(entry.getBlockedThread().threadId()); String name = entry.getBlockedThread().getName(); String exchangeId = entry.getExchange().getExchangeId(); String routeId = entry.getRouteId(); diff --git a/core/camel-management/src/test/java/org/apache/camel/management/ManagedVirtualThreadExecutorTest.java b/core/camel-management/src/test/java/org/apache/camel/management/ManagedVirtualThreadExecutorTest.java index f93bf97591c6d..d72184346268f 100644 --- a/core/camel-management/src/test/java/org/apache/camel/management/ManagedVirtualThreadExecutorTest.java +++ b/core/camel-management/src/test/java/org/apache/camel/management/ManagedVirtualThreadExecutorTest.java @@ -26,15 +26,12 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.spi.LifecycleStrategy; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledForJreRange; -import org.junit.jupiter.api.condition.JRE; import static org.apache.camel.management.DefaultManagementObjectNameStrategy.TYPE_THREAD_POOL; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -@EnabledForJreRange(min = JRE.JAVA_21) public class ManagedVirtualThreadExecutorTest extends ManagementTestSupport { private ExecutorService vte; diff --git a/core/camel-util/pom.xml b/core/camel-util/pom.xml index ac2fcea60d31e..0f9fe6b66e0fe 100644 --- a/core/camel-util/pom.xml +++ b/core/camel-util/pom.xml @@ -92,6 +92,17 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + + @@ -278,53 +289,6 @@ - - java-21-sources - - [21,) - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin-version} - - - default-compile - compile - - compile - - - - compile-java-21 - compile - - compile - - - 21 - ${project.basedir}/src/main/java21 - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - - - - - - - java-25-sources diff --git a/core/camel-util/src/main/java/org/apache/camel/util/concurrent/CamelThreadFactory.java b/core/camel-util/src/main/java/org/apache/camel/util/concurrent/CamelThreadFactory.java index 638fcf1b399d6..4bb6304799745 100644 --- a/core/camel-util/src/main/java/org/apache/camel/util/concurrent/CamelThreadFactory.java +++ b/core/camel-util/src/main/java/org/apache/camel/util/concurrent/CamelThreadFactory.java @@ -20,9 +20,8 @@ import org.slf4j.LoggerFactory; /** - * Thread factory which creates threads supporting a naming pattern. On JDK 21+, this factory creates virtual threads - * when the System property {@code camel.threads.virtual.enabled} is set to {@code true}. On JDK 17, only platform - * threads are available. + * Thread factory which creates threads supporting a naming pattern. The factory creates virtual threads in case the + * System property {@code camel.threads.virtual.enabled} set to {@code true}. */ public final class CamelThreadFactory implements ThreadFactoryTypeAware { private static final Logger LOG = LoggerFactory.getLogger(CamelThreadFactory.class); @@ -30,24 +29,25 @@ public final class CamelThreadFactory implements ThreadFactoryTypeAware { private final String pattern; private final String name; private final boolean daemon; + private final ThreadFactoryType threadType; public CamelThreadFactory(String pattern, String name, boolean daemon) { this.pattern = pattern; this.name = name; this.daemon = daemon; + this.threadType = daemon ? ThreadFactoryType.current() : ThreadFactoryType.PLATFORM; } @Override public boolean isVirtual() { - return false; + return threadType == ThreadFactoryType.VIRTUAL; } @Override public Thread newThread(Runnable runnable) { String threadName = ThreadHelper.resolveThreadName(pattern, name); - Thread answer = new Thread(runnable, threadName); - answer.setDaemon(daemon); + Thread answer = threadType.newThread(threadName, daemon, runnable); LOG.trace("Created thread[{}] -> {}", threadName, answer); return answer; @@ -61,4 +61,27 @@ public String getName() { public String toString() { return "CamelThreadFactory[" + name + "]"; } + + private enum ThreadFactoryType { + PLATFORM { + Thread.Builder newThreadBuilder(String threadName, boolean daemon) { + return Thread.ofPlatform().name(threadName).daemon(daemon); + } + }, + VIRTUAL { + Thread.Builder newThreadBuilder(String threadName, boolean daemon) { + return Thread.ofVirtual().name(threadName); + } + }; + + Thread newThread(String threadName, boolean daemon, Runnable runnable) { + return newThreadBuilder(threadName, daemon).unstarted(runnable); + } + + abstract Thread.Builder newThreadBuilder(String threadName, boolean daemon); + + static ThreadFactoryType current() { + return ThreadType.current() == ThreadType.VIRTUAL ? VIRTUAL : PLATFORM; + } + } } diff --git a/core/camel-util/src/main/java21/org/apache/camel/util/concurrent/CamelThreadFactory.java b/core/camel-util/src/main/java21/org/apache/camel/util/concurrent/CamelThreadFactory.java deleted file mode 100644 index 4bb6304799745..0000000000000 --- a/core/camel-util/src/main/java21/org/apache/camel/util/concurrent/CamelThreadFactory.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.util.concurrent; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Thread factory which creates threads supporting a naming pattern. The factory creates virtual threads in case the - * System property {@code camel.threads.virtual.enabled} set to {@code true}. - */ -public final class CamelThreadFactory implements ThreadFactoryTypeAware { - private static final Logger LOG = LoggerFactory.getLogger(CamelThreadFactory.class); - - private final String pattern; - private final String name; - private final boolean daemon; - private final ThreadFactoryType threadType; - - public CamelThreadFactory(String pattern, String name, boolean daemon) { - this.pattern = pattern; - this.name = name; - this.daemon = daemon; - this.threadType = daemon ? ThreadFactoryType.current() : ThreadFactoryType.PLATFORM; - } - - @Override - public boolean isVirtual() { - return threadType == ThreadFactoryType.VIRTUAL; - } - - @Override - public Thread newThread(Runnable runnable) { - String threadName = ThreadHelper.resolveThreadName(pattern, name); - - Thread answer = threadType.newThread(threadName, daemon, runnable); - - LOG.trace("Created thread[{}] -> {}", threadName, answer); - return answer; - } - - public String getName() { - return name; - } - - @Override - public String toString() { - return "CamelThreadFactory[" + name + "]"; - } - - private enum ThreadFactoryType { - PLATFORM { - Thread.Builder newThreadBuilder(String threadName, boolean daemon) { - return Thread.ofPlatform().name(threadName).daemon(daemon); - } - }, - VIRTUAL { - Thread.Builder newThreadBuilder(String threadName, boolean daemon) { - return Thread.ofVirtual().name(threadName); - } - }; - - Thread newThread(String threadName, boolean daemon, Runnable runnable) { - return newThreadBuilder(threadName, daemon).unstarted(runnable); - } - - abstract Thread.Builder newThreadBuilder(String threadName, boolean daemon); - - static ThreadFactoryType current() { - return ThreadType.current() == ThreadType.VIRTUAL ? VIRTUAL : PLATFORM; - } - } -} diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc index 5b1e7e99e39d9..c17232641011e 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc @@ -13,6 +13,11 @@ See the xref:camel-upgrade-recipes-tool.adoc[documentation] page for details. == Upgrading Camel 4.23 to 4.24 +=== Java + +*Breaking change:* Camel 4.24 requires *Java 21* as the minimum runtime version. +Java 17 is no longer supported. Upgrade your JDK to 21 or later before upgrading to Camel 4.24. + === camel-core - Route.clearRouteModel() is deprecated The `Route.clearRouteModel()` method is deprecated and is now a no-op. It will be removed in a later release. diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-getting-started.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang-getting-started.adoc index 12b90c61a9b86..da6c1c4bbcfcc 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang-getting-started.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-getting-started.adoc @@ -4,7 +4,7 @@ Three commands. That is all it takes to go from zero to a running integration. == Install -Install the Camel CLI with the installer script, which needs only Java 17 or later: +Install the Camel CLI with the installer script, which needs only Java 21 or later: [source,bash] ---- diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-launcher-install.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang-launcher-install.adoc index 7aae2600a640b..b14e96d17b6cb 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang-launcher-install.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-launcher-install.adoc @@ -22,7 +22,7 @@ version can be requested instead with `--version X.Y.Z` (`install.sh`) or `-Vers Both installers download the release archive from Maven Central, verify it against a SHA-256 recorded in a signed-path manifest before extracting it, and reject archives containing absolute paths, `../` traversal, escaping symlinks/reparse points, or more than one top-level directory. The -staged launcher is run once to confirm a Java 17+ runtime can be discovered; if that check fails, +staged launcher is run once to confirm a Java 21+ runtime can be discovered; if that check fails, the previously active installation, if any, is left untouched and the installer exits nonzero. == Installing a specific version @@ -44,7 +44,7 @@ irm https://camel.apache.org/install.ps1 -OutFile install.ps1 == Requirements -* A Java 17+ runtime available at install and run time. The launcher locates Java from +* A Java 21+ runtime available at install and run time. The launcher locates Java from `JAVACMD`, `JAVA_HOME`, or `PATH`. * Linux and macOS: `curl` or `wget`; `tar`; and one of `sha256sum`, `shasum`, or `openssl`. * Windows: PowerShell 5.1 or later (`Invoke-WebRequest`, `Expand-Archive`, `Get-FileHash`). diff --git a/docs/user-manual/modules/ROOT/pages/virtual-threads.adoc b/docs/user-manual/modules/ROOT/pages/virtual-threads.adoc index f2a28dbc992eb..3618ad51ca33f 100644 --- a/docs/user-manual/modules/ROOT/pages/virtual-threads.adoc +++ b/docs/user-manual/modules/ROOT/pages/virtual-threads.adoc @@ -820,7 +820,7 @@ Apache Camel provides the `ContextValue` abstraction that automatically chooses |=== | JDK Version | Virtual Threads Enabled | Implementation -| JDK 17-24 +| JDK 21-24 | N/A | ThreadLocal diff --git a/docs/user-manual/modules/ROOT/pages/what-are-the-dependencies.adoc b/docs/user-manual/modules/ROOT/pages/what-are-the-dependencies.adoc index a80d9581c0b44..b57e42c6b3b65 100644 --- a/docs/user-manual/modules/ROOT/pages/what-are-the-dependencies.adoc +++ b/docs/user-manual/modules/ROOT/pages/what-are-the-dependencies.adoc @@ -7,6 +7,7 @@ - Camel 3.15.0+ requires JDK 11 - Camel 3.17.0+ requires JDK 11 and supports JDK 17 - Camel 4.0.0+ requires JDK 17 and supports JDK 21 +- Camel 4.24.0+ requires JDK 21 You can use Camel CLI which lists up-to-date JDK requirements for every Camel release. diff --git a/dsl/camel-jbang/camel-jbang-container/Makefile b/dsl/camel-jbang/camel-jbang-container/Makefile index 5e30894e3a73d..d65f95fbce134 100644 --- a/dsl/camel-jbang/camel-jbang-container/Makefile +++ b/dsl/camel-jbang/camel-jbang-container/Makefile @@ -29,14 +29,14 @@ endif # Use any other for staging or test purposes IMAGE_NAME ?= docker.io/apache/camel-jbang BASE_IMAGE_NAME := eclipse-temurin -BASE_IMAGE_VERSION := 17-jdk +BASE_IMAGE_VERSION := 21-jdk OFFICIAL_IMAGE_VERSION := 21-jdk BASE_IMAGE := $(BASE_IMAGE_NAME):$(BASE_IMAGE_VERSION) IMAGE_ARCH ?= $(if $(filter arm64 aarch64,$(shell uname -m)),arm64,amd64) OFFICIAL_IMAGE_ARCH := amd64 -JDK_VERSIONS = 17-jdk 21-jdk +JDK_VERSIONS = 21-jdk ARCH_VERSIONS = amd64 arm64 DOCKER_TAG := $(IMAGE_NAME):$(CAMEL_VERSION)-$(BASE_IMAGE_VERSION)-$(IMAGE_ARCH) diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Doctor.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Doctor.java index fa986d04f1c59..856df9bca23ba 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Doctor.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Doctor.java @@ -140,15 +140,15 @@ private void checkJava() { int major = Runtime.version().feature(); String status; String result; - if (major >= 21) { + if (major >= 25) { status = OK; result = "OK"; - } else if (major >= 17) { + } else if (major >= 21) { status = OK; - result = "OK (consider upgrading to 21 or 25 for better performance)"; + result = "OK (consider upgrading to 25 for better performance)"; } else { status = FAIL; - result = "UNSUPPORTED (17+ required)"; + result = "UNSUPPORTED (21+ required)"; } report("java", "Java", status, "%s (%s) (%s)".formatted(version, vendor, result)); } diff --git a/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/MigrationTools.java b/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/MigrationTools.java index 7ec2bc9c343be..b0febb99df8be 100644 --- a/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/MigrationTools.java +++ b/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/MigrationTools.java @@ -123,7 +123,7 @@ public CompatibilityResult camel_migration_compatibility( @ToolArg(description = "Current Camel version (e.g., 3.20.0)") String currentVersion, @ToolArg(description = "Target Camel version (e.g., 4.18.0)") String targetVersion, @ToolArg(description = ToolArgDocs.RUNTIME_REQUIRED) String runtime, - @ToolArg(description = "Current Java version (e.g., 11, 17, 21)", required = false) String javaVersion) { + @ToolArg(description = "Current Java version (e.g., 21, 25)", required = false) String javaVersion) { if (currentVersion == null || currentVersion.isBlank()) { throw new ToolCallException("currentVersion is required", null); @@ -211,7 +211,7 @@ public MigrationRecipesResult camel_migration_recipes( @ToolArg(description = ToolArgDocs.RUNTIME_REQUIRED) String runtime, @ToolArg(description = "Current Camel version (e.g., 4.4.0)") String currentVersion, @ToolArg(description = "Target Camel version (e.g., 4.18.0)") String targetVersion, - @ToolArg(description = "Current Java version (e.g., 11, 17)", required = false) String javaVersion, + @ToolArg(description = "Current Java version (e.g., 21, 25)", required = false) String javaVersion, @ToolArg(description = "If true, perform a dry run without making changes (default: true)", required = false) Boolean dryRun, @ToolArg(description = "Quarkus only: the Quarkus platform version to update to (e.g. 3.27.1), the one " diff --git a/dsl/camel-jbang/camel-launcher/src/install/install.ps1 b/dsl/camel-jbang/camel-launcher/src/install/install.ps1 index 552c426a93706..a653646af26dd 100644 --- a/dsl/camel-jbang/camel-launcher/src/install/install.ps1 +++ b/dsl/camel-jbang/camel-launcher/src/install/install.ps1 @@ -226,17 +226,17 @@ function Test-ArchiveEntry { } } -# Runs the freshly staged upstream launcher; a nonzero exit (e.g. no Java 17+ available) aborts the +# Runs the freshly staged upstream launcher; a nonzero exit (e.g. no Java 21+ available) aborts the # install and leaves the previously active installation untouched. function Test-StagedLauncher { param([string] $LauncherPath) try { & $LauncherPath 'version' *> $null } catch { - Fail "staged launcher failed verification (Java 17+ required)" + Fail "staged launcher failed verification (Java 21+ required)" } if ($LASTEXITCODE -ne 0) { - Fail "staged launcher failed verification (Java 17+ required)" + Fail "staged launcher failed verification (Java 21+ required)" } } diff --git a/dsl/camel-jbang/camel-launcher/src/install/install.sh b/dsl/camel-jbang/camel-launcher/src/install/install.sh index 6057dd694a831..343ee4aa7d389 100755 --- a/dsl/camel-jbang/camel-launcher/src/install/install.sh +++ b/dsl/camel-jbang/camel-launcher/src/install/install.sh @@ -194,12 +194,12 @@ validate_tar() { grep -Fqx "$expected_root/bin/camel.sh" "$listing" || fail "archive is missing bin/camel.sh" } -# Runs the freshly staged upstream launcher; a nonzero exit (e.g. no Java 17+ available) aborts +# Runs the freshly staged upstream launcher; a nonzero exit (e.g. no Java 21+ available) aborts # the install and leaves the previously active installation untouched. verify_staged() { staged_sh="$1" chmod +x "$staged_sh" 2>/dev/null || true - "$staged_sh" version >/dev/null 2>&1 || fail "staged launcher failed verification (Java 17+ required)" + "$staged_sh" version >/dev/null 2>&1 || fail "staged launcher failed verification (Java 21+ required)" } activate() { diff --git a/dsl/camel-jbang/camel-launcher/src/jreleaser/distributions/camel-cli/sdkman/release-notes.md b/dsl/camel-jbang/camel-launcher/src/jreleaser/distributions/camel-cli/sdkman/release-notes.md index fea5d6177f7fb..10a778b12ad77 100644 --- a/dsl/camel-jbang/camel-launcher/src/jreleaser/distributions/camel-cli/sdkman/release-notes.md +++ b/dsl/camel-jbang/camel-launcher/src/jreleaser/distributions/camel-cli/sdkman/release-notes.md @@ -23,8 +23,8 @@ `publish` implementation to include when composing the SDKMAN release announcement. --> -Apache Camel CLI requires Java 17 or newer. If you do not already have a +Apache Camel CLI requires Java 21 or newer. If you do not already have a compatible Java, "sdk install java" provides one and SDKMAN will export -JAVA_HOME for it; any other Java 17+ runtime works equally well. The bin/camel +JAVA_HOME for it; any other Java 21+ runtime works equally well. The bin/camel launcher discovers Java via JAVACMD, JAVA_HOME, PATH, then CAMEL_FALLBACK_JAVA, and prints a diagnostic listing these sources if none qualify. diff --git a/dsl/camel-jbang/camel-launcher/src/main/resources/bin/camel.bat b/dsl/camel-jbang/camel-launcher/src/main/resources/bin/camel.bat index 9d485f9a39f99..2df7eeaa70b50 100644 --- a/dsl/camel-jbang/camel-launcher/src/main/resources/bin/camel.bat +++ b/dsl/camel-jbang/camel-launcher/src/main/resources/bin/camel.bat @@ -28,9 +28,9 @@ set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set BASEDIR=%DIRNAME% -@REM --- Shared Java 17+ discovery contract --- +@REM --- Shared Java 21+ discovery contract --- @REM Candidates in order: JAVACMD, %JAVA_HOME%\bin\java.exe, java.exe on PATH, CAMEL_FALLBACK_JAVA. -set CAMEL_MIN_JAVA=17 +set CAMEL_MIN_JAVA=21 set "CAMEL_JAVACMD=" call :tryJava "%JAVACMD%" diff --git a/dsl/camel-jbang/camel-launcher/src/main/resources/bin/camel.sh b/dsl/camel-jbang/camel-launcher/src/main/resources/bin/camel.sh index 36a66c77efaba..f38fa2edbe37e 100644 --- a/dsl/camel-jbang/camel-launcher/src/main/resources/bin/camel.sh +++ b/dsl/camel-jbang/camel-launcher/src/main/resources/bin/camel.sh @@ -47,12 +47,12 @@ if $cygwin ; then [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` fi -# --- Shared Java 17+ discovery contract --- +# --- Shared Java 21+ discovery contract --- # Candidates are tried in order: JAVACMD, $JAVA_HOME/bin/java, java on PATH, CAMEL_FALLBACK_JAVA. # ($JAVA_HOME is also how SDKMAN's java candidate exposes its runtime.) # Each must exist, be executable, and report a Java major version >= CAMEL_MIN_JAVA. # Probe output is captured and never printed during a normal invocation. -CAMEL_MIN_JAVA=17 +CAMEL_MIN_JAVA=21 # Echo the Java major version of the launcher in $1, or nothing if it cannot be determined. camel_java_major() { diff --git a/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelBatDiscoveryTest.java b/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelBatDiscoveryTest.java index 03883353c0eb6..e78134ad0ddc1 100644 --- a/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelBatDiscoveryTest.java +++ b/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelBatDiscoveryTest.java @@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * Windows equivalent of {@link CamelShDiscoveryTest}: verifies camel.bat implements the same shared Java 17+ discovery + * Windows equivalent of {@link CamelShDiscoveryTest}: verifies camel.bat implements the same shared Java 21+ discovery * contract with observably equivalent behavior. */ @EnabledOnOs(OS.WINDOWS) @@ -48,11 +48,12 @@ class CamelBatDiscoveryTest { private static final Path SCRIPT = Paths.get("src/main/resources/bin/camel.bat"); - private static final String JAVA17 = "openjdk version \"17.0.2\" 2022-01-18"; private static final String JAVA21 = "openjdk version \"21.0.3\" 2024-04-16"; + private static final String JAVA25 = "openjdk version \"25\" 2025-09-16"; + private static final String JAVA17 = "openjdk version \"17.0.2\" 2022-01-18"; + private static final String JAVA17_EA = "openjdk version \"17-ea\""; private static final String JAVA11 = "openjdk version \"11.0.20\" 2023-07-18"; private static final String JAVA8 = "java version \"1.8.0_202\""; - private static final String JAVA17_EA = "openjdk version \"17-ea\""; private static final String GARBAGE = "totally not a java banner"; private Path home(Path base) throws Exception { @@ -83,7 +84,7 @@ void skipsSourcesAndJavadocJars(@TempDir Path base) throws Exception { Files.writeString(h.resolve("camel-launcher-zzz-sources.jar"), "sources"); Files.writeString(h.resolve("camel-launcher-9.9.9-javadoc.jar"), "javadoc"); Files.writeString(h.resolve("camel-launcher-zzz-javadoc.jar"), "javadoc"); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "JAVACMD"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "JAVACMD"); Map env = isolatedEnvironment(); env.put("JAVACMD", java.toString()); @@ -96,9 +97,9 @@ void skipsSourcesAndJavadocJars(@TempDir Path base) throws Exception { } @Test - void acceptsJava17ViaJavacmd(@TempDir Path base) throws Exception { + void acceptsJava21ViaJavacmd(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "JAVACMD"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "JAVACMD"); Map env = isolatedEnvironment(); env.put("JAVACMD", java.toString()); @@ -110,23 +111,10 @@ void acceptsJava17ViaJavacmd(@TempDir Path base) throws Exception { assertFalse(r.stderr().contains("openjdk version"), "probe banner leaked to stderr"); } - @Test - void acceptsJava21ViaJavacmd(@TempDir Path base) throws Exception { - Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "JAVA21"); - Map env = isolatedEnvironment(); - env.put("JAVACMD", java.toString()); - - FakeJava.Result r = FakeJava.run(h.resolve("camel.bat"), env, "version"); - - assertEquals(0, r.exitCode(), r.stderr()); - assertTrue(r.stdout().contains("RAN=JAVA21"), r.stdout()); - } - @Test void precedenceJavacmdBeatsJavaHome(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "JAVACMD-FIRST"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "JAVACMD-FIRST"); Map env = isolatedEnvironment(); env.put("JAVACMD", java.toString()); env.put("JAVA_HOME", currentJavaHome().toString()); @@ -216,7 +204,7 @@ void acceptsNativeJavaFromPath(@TempDir Path base) throws Exception { void precedenceNativePathBeatsCamelFallbackJava(@TempDir Path base) throws Exception { Path h = home(base); writeRealJavaMarkerJar(h); - Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA17, 0, "FALLBACK"); + Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA21, 0, "FALLBACK"); Map env = isolatedEnvironment(); env.put("PATH", currentJavaHome().resolve("bin") + ";" + env.get("PATH")); env.put("CAMEL_FALLBACK_JAVA", fallback.toString()); @@ -232,7 +220,7 @@ void precedenceNativePathBeatsCamelFallbackJava(@TempDir Path base) throws Excep void skipsOldJavacmdFallsBackToFallback(@TempDir Path base) throws Exception { Path h = home(base); Path old = FakeJava.writeFakeJava(base.resolve("old"), "java", JAVA11, 0, "OLD"); - Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA17, 0, "FALLBACK"); + Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA21, 0, "FALLBACK"); Map env = isolatedEnvironment(); env.put("JAVACMD", old.toString()); env.put("JAVA_HOME", base.resolve("invalid-java-home").toString()); @@ -255,7 +243,7 @@ void rejectsWhenNoCandidateQualifies(@TempDir Path base) throws Exception { FakeJava.Result r = FakeJava.run(h.resolve("camel.bat"), env, "version"); assertEquals(1, r.exitCode()); - assertTrue(r.stderr().contains("17"), "diagnostic must state the Java 17 minimum: " + r.stderr()); + assertTrue(r.stderr().contains("21"), "diagnostic must state the Java 21 minimum: " + r.stderr()); assertTrue(r.stderr().toLowerCase().contains("java"), r.stderr()); } @@ -275,7 +263,7 @@ void rejectsUnparseableCandidate(@TempDir Path base) throws Exception { void rejectsNonnumericMajorAndContinuesToFallback(@TempDir Path base) throws Exception { Path h = home(base); Path earlyAccess = FakeJava.writeFakeJava(base.resolve("early-access"), "java", JAVA17_EA, 0, "EARLY"); - Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA17, 0, "FALLBACK"); + Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA21, 0, "FALLBACK"); Map env = isolatedEnvironment(); env.put("JAVACMD", earlyAccess.toString()); env.put("CAMEL_FALLBACK_JAVA", fallback.toString()); @@ -290,7 +278,7 @@ void rejectsNonnumericMajorAndContinuesToFallback(@TempDir Path base) throws Exc @Test void handlesSpacesAndUnicodeInJavaPath(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base.resolve("spa ce/über"), "java", JAVA17, 0, "UNICODE"); + Path java = FakeJava.writeFakeJava(base.resolve("spa ce/über"), "java", JAVA21, 0, "UNICODE"); Map env = isolatedEnvironment(); env.put("JAVACMD", java.toString()); @@ -303,7 +291,7 @@ void handlesSpacesAndUnicodeInJavaPath(@TempDir Path base) throws Exception { @Test void defaultsHeapWhenJavaOptsUnset(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "HEAP"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "HEAP"); Map env = isolatedEnvironment(); env.put("JAVACMD", java.toString()); @@ -316,7 +304,7 @@ void defaultsHeapWhenJavaOptsUnset(@TempDir Path base) throws Exception { @Test void preservesJavaOptsWhenSet(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "OPTS"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "OPTS"); Map env = isolatedEnvironment(); env.put("JAVACMD", java.toString()); env.put("JAVA_OPTS", "-Dcamel.test=1 -Xmx256m"); @@ -334,7 +322,7 @@ void javacmdBatchWrapperReturnsForProbeAndLaunchAndPreservesBehavior(@TempDir Pa Path h = home(base); Path wrapper = writeBatch(base.resolve("wrapper"), "java", "if \"%~1\"==\"-version\" (", - " echo " + JAVA17 + " 1>&2", + " echo " + JAVA21 + " 1>&2", " exit /b 0", ")", "set ARG_COUNT=0", @@ -371,7 +359,7 @@ void javacmdBatchWrapperReturnsForProbeAndLaunchAndPreservesBehavior(@TempDir Pa void finalBatchWrapperReturnsToLauncherStatementAfterCall(@TempDir Path base) throws Exception { Path sentinel = base.resolve("launcher-resumed.txt"); Path h = instrumentBatchLaunchReturn(home(base), sentinel); - Path wrapper = FakeJava.writeFakeJava(base.resolve("wrapper"), "java", JAVA17, 41, "RETURN"); + Path wrapper = FakeJava.writeFakeJava(base.resolve("wrapper"), "java", JAVA21, 41, "RETURN"); Map env = isolatedEnvironment(); env.put("JAVACMD", wrapper.toString()); @@ -386,7 +374,7 @@ void finalBatchWrapperReturnsToLauncherStatementAfterCall(@TempDir Path base) th void fallbackBatchWrapperIsReachedAfterInvalidCandidatesAndPropagatesExit(@TempDir Path base) throws Exception { Path h = home(base); Path old = FakeJava.writeFakeJava(base.resolve("old"), "java", JAVA11, 0, "OLD"); - Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA17, 29, "FALLBACK-WRAPPER"); + Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA21, 29, "FALLBACK-WRAPPER"); Map env = isolatedEnvironment(); env.put("JAVACMD", old.toString()); env.put("JAVA_HOME", base.resolve("missing-home").toString()); @@ -405,7 +393,7 @@ void baseDirProbeFallbackCleansArtifactWhenTempAndTmpAreAbsent(@TempDir Path bas Path java = writeBatch(base.resolve("wrapper"), "java", "if \"%~1\"==\"-version\" (", " echo %_PROBE% >\"" + probePathMarker + "\"", - " echo " + JAVA17 + " 1>&2", + " echo " + JAVA21 + " 1>&2", " exit /b 0", ")", "echo RAN=BASEDIR-PROBE", @@ -431,11 +419,11 @@ void skipsValidLookingBannerWhenProbeExitsNonzero(@TempDir Path base) throws Exc Path h = home(base); Path rejected = writeBatch(base.resolve("rejected"), "java", "if \"%~1\"==\"-version\" (", - " echo " + JAVA17 + " 1>&2", + " echo " + JAVA21 + " 1>&2", " exit /b 7", ")", "echo RAN=REJECTED"); - Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA17, 0, "FALLBACK"); + Path fallback = FakeJava.writeFakeJava(base.resolve("fallback"), "java", JAVA21, 0, "FALLBACK"); Map env = isolatedEnvironment(); env.put("JAVACMD", rejected.toString()); env.put("CAMEL_FALLBACK_JAVA", fallback.toString()); @@ -453,7 +441,7 @@ void acceptsValidBannerAfterPreBannerLineContainingVersion(@TempDir Path base) t Path java = writeBatch(base.resolve("banner"), "java", "if \"%~1\"==\"-version\" (", " echo wrapper version metadata 1>&2", - " echo " + JAVA17 + " 1>&2", + " echo " + JAVA21 + " 1>&2", " exit /b 0", ")", "echo RAN=VALID-BANNER", @@ -475,7 +463,7 @@ void probeCannotConsumeChildStdin(@TempDir Path base) throws Exception { Path java = writeBatch(base.resolve("stdin"), "java", "if \"%~1\"==\"-version\" (", " set /p \"ignored=\"", - " echo " + JAVA17 + " 1>&2", + " echo " + JAVA21 + " 1>&2", " exit /b 0", ")", "echo RAN=PROBE-STDIN", diff --git a/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelShDiscoveryTest.java b/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelShDiscoveryTest.java index 08fac4adf315d..71f15c2006772 100644 --- a/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelShDiscoveryTest.java +++ b/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelShDiscoveryTest.java @@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * Verifies the shared Java 17+ discovery contract implemented in camel.sh. POSIX only; the Windows batch equivalent + * Verifies the shared Java 21+ discovery contract implemented in camel.sh. POSIX only; the Windows batch equivalent * lives in {@link CamelBatDiscoveryTest}. */ @DisabledOnOs(OS.WINDOWS) @@ -40,8 +40,9 @@ class CamelShDiscoveryTest { private static final Path SCRIPT = Paths.get("src/main/resources/bin/camel.sh"); - private static final String JAVA17 = "openjdk version \"17.0.2\" 2022-01-18"; private static final String JAVA21 = "openjdk version \"21.0.3\" 2024-04-16"; + private static final String JAVA25 = "openjdk version \"25\" 2025-09-16"; + private static final String JAVA17 = "openjdk version \"17.0.2\" 2022-01-18"; private static final String JAVA11 = "openjdk version \"11.0.20\" 2023-07-18"; private static final String JAVA8 = "java version \"1.8.0_202\""; private static final String GARBAGE = "totally not a java banner"; @@ -63,7 +64,7 @@ void skipsSourcesAndJavadocJars(@TempDir Path base) throws Exception { Files.writeString(h.resolve("camel-launcher-zzz-sources.jar"), "sources"); Files.writeString(h.resolve("camel-launcher-9.9.9-javadoc.jar"), "javadoc"); Files.writeString(h.resolve("camel-launcher-zzz-javadoc.jar"), "javadoc"); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "JAVACMD"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "JAVACMD"); Map env = new HashMap<>(); env.put("LC_ALL", "C"); env.put("JAVACMD", java.toString()); @@ -77,9 +78,9 @@ void skipsSourcesAndJavadocJars(@TempDir Path base) throws Exception { } @Test - void acceptsJava17ViaJavacmd(@TempDir Path base) throws Exception { + void acceptsJava21ViaJavacmd(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "JAVACMD"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "JAVACMD"); Map env = new HashMap<>(); env.put("JAVACMD", java.toString()); @@ -108,7 +109,7 @@ void acceptsJava21(@TempDir Path base) throws Exception { @Test void precedenceJavacmdBeatsJavaHomeAndPath(@TempDir Path base) throws Exception { Path h = home(base); - Path first = FakeJava.writeFakeJava(base.resolve("j1"), "java", JAVA17, 0, "JAVACMD"); + Path first = FakeJava.writeFakeJava(base.resolve("j1"), "java", JAVA21, 0, "JAVACMD"); Path jhomeBin = base.resolve("jh/bin"); FakeJava.writeFakeJava(jhomeBin, "java", JAVA21, 0, "JAVAHOME"); Path pathDir = base.resolve("pd"); @@ -130,7 +131,7 @@ void honorsJavaHomeWhenOnlySourceLikeSdkman(@TempDir Path base) throws Exception // SDKMAN provides Java by exporting JAVA_HOME (candidate #2) with no JAVACMD set. Path h = home(base); Path jhomeBin = base.resolve("jh/bin"); - FakeJava.writeFakeJava(jhomeBin, "java", JAVA17, 0, "JAVAHOME"); + FakeJava.writeFakeJava(jhomeBin, "java", JAVA21, 0, "JAVAHOME"); Map env = new HashMap<>(); env.put("JAVA_HOME", base.resolve("jh").toString()); @@ -146,7 +147,7 @@ void honorsJavaHomeWhenOnlySourceLikeSdkman(@TempDir Path base) throws Exception void skipsInvalidJavacmdFallsBackToJavaHome(@TempDir Path base) throws Exception { Path h = home(base); Path jhomeBin = base.resolve("jh/bin"); - FakeJava.writeFakeJava(jhomeBin, "java", JAVA17, 0, "JAVAHOME"); + FakeJava.writeFakeJava(jhomeBin, "java", JAVA21, 0, "JAVAHOME"); Map env = new HashMap<>(); env.put("JAVACMD", base.resolve("does-not-exist").toString()); @@ -165,7 +166,7 @@ void skipsNonExecutableJavacmdFallsBackToJavaHome(@TempDir Path base) throws Exc Files.writeString(nonExecutable, "#!/bin/sh\nexit 0\n"); assertFalse(Files.isExecutable(nonExecutable), "test candidate must not be executable"); Path jhomeBin = base.resolve("jh/bin"); - FakeJava.writeFakeJava(jhomeBin, "java", JAVA17, 0, "JAVAHOME"); + FakeJava.writeFakeJava(jhomeBin, "java", JAVA21, 0, "JAVAHOME"); Map env = new HashMap<>(); env.put("JAVACMD", nonExecutable.toString()); @@ -183,7 +184,7 @@ void skipsOldJavaHomeFallsBackToPath(@TempDir Path base) throws Exception { Path jhomeBin = base.resolve("jh/bin"); FakeJava.writeFakeJava(jhomeBin, "java", JAVA11, 0, "JAVAHOME"); // too old Path pathDir = base.resolve("pd"); - FakeJava.writeFakeJava(pathDir, "java", JAVA17, 0, "PATH"); + FakeJava.writeFakeJava(pathDir, "java", JAVA21, 0, "PATH"); Map env = new HashMap<>(); env.put("JAVA_HOME", base.resolve("jh").toString()); @@ -201,7 +202,7 @@ void skipsOldJavaHomeFallsBackToPath(@TempDir Path base) throws Exception { void precedenceJavaHomeBeatsPath(@TempDir Path base) throws Exception { Path h = home(base); Path jhomeBin = base.resolve("jh/bin"); - FakeJava.writeFakeJava(jhomeBin, "java", JAVA17, 0, "JAVAHOME"); + FakeJava.writeFakeJava(jhomeBin, "java", JAVA21, 0, "JAVAHOME"); Path pathDir = base.resolve("pd"); FakeJava.writeFakeJava(pathDir, "java", JAVA21, 0, "PATH"); @@ -219,7 +220,7 @@ void precedenceJavaHomeBeatsPath(@TempDir Path base) throws Exception { void precedencePathBeatsCamelFallbackJava(@TempDir Path base) throws Exception { Path h = home(base); Path pathDir = base.resolve("pd"); - FakeJava.writeFakeJava(pathDir, "java", JAVA17, 0, "PATH"); + FakeJava.writeFakeJava(pathDir, "java", JAVA21, 0, "PATH"); Path fallback = FakeJava.writeFakeJava(base.resolve("fb"), "java", JAVA21, 0, "FALLBACK"); Map env = new HashMap<>(); @@ -235,7 +236,7 @@ void precedencePathBeatsCamelFallbackJava(@TempDir Path base) throws Exception { @Test void usesCamelFallbackJavaWhenNothingElseQualifies(@TempDir Path base) throws Exception { Path h = home(base); - Path fb = FakeJava.writeFakeJava(base.resolve("fb"), "java", JAVA17, 0, "FALLBACK"); + Path fb = FakeJava.writeFakeJava(base.resolve("fb"), "java", JAVA21, 0, "FALLBACK"); Map env = new HashMap<>(); env.put("PATH", pathWithNonqualifyingJava(base)); @@ -259,7 +260,7 @@ void rejectsWhenNoCandidateQualifies(@TempDir Path base) throws Exception { FakeJava.Result r = FakeJava.run(h.resolve("camel.sh"), env, "version"); assertEquals(1, r.exitCode()); - assertTrue(r.stderr().contains("17"), "diagnostic must state the Java 17 minimum: " + r.stderr()); + assertTrue(r.stderr().contains("21"), "diagnostic must state the Java 21 minimum: " + r.stderr()); assertTrue(r.stderr().toLowerCase().contains("java"), r.stderr()); } @@ -282,7 +283,7 @@ void skipsUnparseableJavacmdFallsBackToJavaHome(@TempDir Path base) throws Excep Path h = home(base); Path garbage = FakeJava.writeFakeJava(base.resolve("g"), "java", GARBAGE, 0, "GARBAGE"); Path jhomeBin = base.resolve("jh/bin"); - FakeJava.writeFakeJava(jhomeBin, "java", JAVA17, 0, "JAVAHOME"); + FakeJava.writeFakeJava(jhomeBin, "java", JAVA21, 0, "JAVAHOME"); Map env = new HashMap<>(); env.put("JAVACMD", garbage.toString()); @@ -315,7 +316,7 @@ void parsesLegacyOneDotEightAsMajorEight(@TempDir Path base) throws Exception { void handlesSpacesAndUnicodeInJavaPath(@TempDir Path base) throws Exception { Path h = home(base); Path dir = base.resolve("spa ce/über"); - Path java = FakeJava.writeFakeJava(dir, "java", JAVA17, 0, "UNICODE"); + Path java = FakeJava.writeFakeJava(dir, "java", JAVA21, 0, "UNICODE"); Map env = new HashMap<>(); env.put("JAVACMD", java.toString()); @@ -329,7 +330,7 @@ void handlesSpacesAndUnicodeInJavaPath(@TempDir Path base) throws Exception { @Test void preservesArgumentsWithSpaces(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "ARGS"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "ARGS"); Map env = new HashMap<>(); env.put("JAVACMD", java.toString()); @@ -342,7 +343,7 @@ void preservesArgumentsWithSpaces(@TempDir Path base) throws Exception { @Test void defaultsHeapWhenJavaOptsUnset(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "HEAP"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "HEAP"); Map env = new HashMap<>(); env.put("JAVACMD", java.toString()); @@ -354,7 +355,7 @@ void defaultsHeapWhenJavaOptsUnset(@TempDir Path base) throws Exception { @Test void preservesJavaOptsWhenSet(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "OPTS"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "OPTS"); Map env = new HashMap<>(); env.put("JAVACMD", java.toString()); env.put("JAVA_OPTS", "-Dcamel.test=1 -Xmx256m"); @@ -369,7 +370,7 @@ void preservesJavaOptsWhenSet(@TempDir Path base) throws Exception { @Test void preservesChildExitCode(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 42, "EXIT"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 42, "EXIT"); Map env = new HashMap<>(); env.put("JAVACMD", java.toString()); @@ -381,7 +382,7 @@ void preservesChildExitCode(@TempDir Path base) throws Exception { @Test void preservesChildStdinStdoutAndStderr(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "STDIO"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "STDIO"); Map env = new HashMap<>(); env.put("JAVACMD", java.toString()); @@ -396,11 +397,11 @@ void preservesChildStdinStdoutAndStderr(@TempDir Path base) throws Exception { @Test void probeCannotConsumeChildStdin(@TempDir Path base) throws Exception { Path h = home(base); - Path java = FakeJava.writeFakeJava(base, "java", JAVA17, 0, "PROBE-STDIN"); + Path java = FakeJava.writeFakeJava(base, "java", JAVA21, 0, "PROBE-STDIN"); Files.writeString(java, "#!/bin/sh\n" + "if [ \"$1\" = \"-version\" ]; then\n" + " IFS= read -r ignored\n" - + " echo '" + JAVA17 + "' 1>&2\n" + + " echo '" + JAVA21 + "' 1>&2\n" + " exit 0\n" + "fi\n" + "echo 'RAN=PROBE-STDIN'\n" diff --git a/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/FakeJavaTest.java b/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/FakeJavaTest.java index fb99336cc9228..bc20bc80b538a 100644 --- a/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/FakeJavaTest.java +++ b/dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/FakeJavaTest.java @@ -51,7 +51,7 @@ void drainsStdoutAndStderrWithoutDeadlock() throws Exception { @Test void fakeJavaPreservesInputAndNormalStderr() throws Exception { - Path java = FakeJava.writeFakeJava(tempDir, "java", "openjdk version \"17.0.2\"", 0, "STDIO"); + Path java = FakeJava.writeFakeJava(tempDir, "java", "openjdk version \"21.0.3\"", 0, "STDIO"); FakeJava.Result result = FakeJava.runWithInput(java, Map.of(), "route input\n", "version"); diff --git a/pom.xml b/pom.xml index aaf7d6f4722af..52bd211ba4732 100644 --- a/pom.xml +++ b/pom.xml @@ -110,7 +110,7 @@ UTF-8 scpexe://people.apache.org/www/camel.apache.org/maven/ - 17 + 21 ${jdk.version} ${jdk.version} @@ -199,7 +199,7 @@ [21,) - JDK 21+ is required to build Apache Camel. JDK 21-specific classes (e.g., virtual thread support in camel-util) are only compiled with JDK 21+. Building with JDK 17 silently omits these classes from the resulting JARs. + JDK 21+ is required to build Apache Camel.