diff --git a/.tool-versions b/.tool-versions index 3836c1c1548e2..781703fabb39d 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -java adoptopenjdk-17.0.5+8 +java adoptopenjdk-21.0.2+13.0.LTS maven 3.9.9 trivy 0.54.1 diff --git a/component-runtime-beam/src/it/serialization-over-cluster/pom.xml b/component-runtime-beam/src/it/serialization-over-cluster/pom.xml index 28aa40ac7bb5a..7dd6fb75ffdf1 100644 --- a/component-runtime-beam/src/it/serialization-over-cluster/pom.xml +++ b/component-runtime-beam/src/it/serialization-over-cluster/pom.xml @@ -181,7 +181,14 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M5 + + 3.2.5 integration-test diff --git a/component-runtime-impl/pom.xml b/component-runtime-impl/pom.xml index 6eb55ac703a11..ed329580ba3f0 100644 --- a/component-runtime-impl/pom.xml +++ b/component-runtime-impl/pom.xml @@ -53,12 +53,6 @@ ${log4j2.version} test - - nl.jqno.equalsverifier - equalsverifier - 3.7.2 - test - diff --git a/component-runtime-impl/src/test/java/org/talend/sdk/component/runtime/record/SchemaImplTest.java b/component-runtime-impl/src/test/java/org/talend/sdk/component/runtime/record/SchemaImplTest.java index f9e314dfe06b0..0e7ddc4ab3a9c 100644 --- a/component-runtime-impl/src/test/java/org/talend/sdk/component/runtime/record/SchemaImplTest.java +++ b/component-runtime-impl/src/test/java/org/talend/sdk/component/runtime/record/SchemaImplTest.java @@ -51,9 +51,6 @@ import org.talend.sdk.component.runtime.record.SchemaImpl.BuilderImpl; import org.talend.sdk.component.runtime.record.SchemaImpl.EntryImpl; -import nl.jqno.equalsverifier.EqualsVerifier; -import nl.jqno.equalsverifier.Warning; - class SchemaImplTest { private final Schema.Entry data1 = new SchemaImpl.EntryImpl.BuilderImpl() // @@ -85,13 +82,42 @@ void checkEquals() { final RecordBuilderFactory f = new RecordBuilderFactoryImpl("test"); final Entry first = f.newEntryBuilder().withName("First").withType(Type.STRING).build(); final Entry second = f.newEntryBuilder().withName("Second").withType(Type.STRING).build(); - EqualsVerifier.simple() - .suppress(Warning.STRICT_HASHCODE) // Supress test hashcode use all fields used by equals (for legacy) - .forClass(SchemaImpl.class) - .withPrefabValues(Schema.Entry.class, first, second) - .withIgnoredFields("entriesOrder", "entryMap") - .withPrefabValues(EntriesOrder.class, EntriesOrder.of("First"), EntriesOrder.of("Second")) - .verify(); + + // Create two identical schemas + final Schema schema1 = new BuilderImpl() + .withType(Type.RECORD) + .withEntry(first) + .withEntry(second) + .build(); + + final Schema schema2 = new BuilderImpl() + .withType(Type.RECORD) + .withEntry(first) + .withEntry(second) + .build(); + + // Create a different schema + final Schema schema3 = new BuilderImpl() + .withType(Type.RECORD) + .withEntry(first) + .build(); + + // Test equals reflexivity + assertEquals(schema1, schema1); + + // Test equals symmetry + assertEquals(schema1, schema2); + assertEquals(schema2, schema1); + + // Test equals with different object + Assertions.assertNotEquals(schema1, schema3); + Assertions.assertNotEquals(schema3, schema1); + + // Test hashCode consistency + assertEquals(schema1.hashCode(), schema2.hashCode()); + + // Test null + Assertions.assertNotEquals(schema1, null); } @Test diff --git a/component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/asm/ProxyGenerator.java b/component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/asm/ProxyGenerator.java index b89697c94b8ac..6f40a1f1787f6 100644 --- a/component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/asm/ProxyGenerator.java +++ b/component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/asm/ProxyGenerator.java @@ -64,6 +64,7 @@ import static org.apache.xbean.asm9.Opcodes.RETURN; import static org.apache.xbean.asm9.Opcodes.SIPUSH; import static org.apache.xbean.asm9.Opcodes.V1_8; +import static org.apache.xbean.asm9.Opcodes.V21; import java.io.InputStream; import java.io.ObjectStreamException; @@ -108,12 +109,38 @@ public ProxyGenerator() { } private int determineDefaultJavaVersion() { - final String javaVersionProp = System.getProperty("java.version", "1.8"); - if (javaVersionProp.startsWith("1.8")) { // we don't support earlier + final String javaVersionProp = System.getProperty("java.version", "21"); + // Legacy "1.x" naming (Java 8 and below) + if (javaVersionProp.startsWith("1.")) { + // anything older than 1.8 is unsupported; bump to the minimum return V1_8; } - // add java 9 test when upgrading asm - return V1_8; // return higher one + // Modern naming: "9", "10", ..., "17", "21", possibly followed by "." or "-" + final int sep = indexOfNonDigit(javaVersionProp); + final String majorStr = sep < 0 ? javaVersionProp : javaVersionProp.substring(0, sep); + final int major; + try { + major = Integer.parseInt(majorStr); + } catch (final NumberFormatException e) { + return V21; // safe fallback aligned with the project baseline (Java 21) + } + if (major <= 8) { + return V1_8; + } + // ASM Vxx opcodes are sequential: V1_8 = 52, V9 = 53, ... so Vmajor = 44 + major. + // Cap at V21 to stay within the project's compilation baseline and avoid + // emitting class files newer than the runtime we have validated. + final int capped = Math.min(major, 21); + return 44 + capped; + } + + private static int indexOfNonDigit(final String s) { + for (int i = 0; i < s.length(); i++) { + if (!Character.isDigit(s.charAt(i))) { + return i; + } + } + return -1; } private void createSerialisation(final ClassWriter cw, final String pluginId, final String key) { diff --git a/component-runtime-testing/component-runtime-http-junit/pom.xml b/component-runtime-testing/component-runtime-http-junit/pom.xml index 131f28c5d62f5..1694f871f4341 100644 --- a/component-runtime-testing/component-runtime-http-junit/pom.xml +++ b/component-runtime-testing/component-runtime-http-junit/pom.xml @@ -29,6 +29,7 @@ 4.1.135.Final + 1.78.1 ${talend.build.name.base}.junit.http @@ -117,6 +118,18 @@ ${ziplock.version} test + + + org.bouncycastle + bcpkix-jdk18on + ${bouncycastle.version} + test + diff --git a/component-runtime-testing/component-runtime-testing-spark/src/main/java/org/talend/sdk/component/runtime/testing/spark/internal/BaseSpark.java b/component-runtime-testing/component-runtime-testing-spark/src/main/java/org/talend/sdk/component/runtime/testing/spark/internal/BaseSpark.java index e0e95ee569275..2737c2bb788c3 100644 --- a/component-runtime-testing/component-runtime-testing-spark/src/main/java/org/talend/sdk/component/runtime/testing/spark/internal/BaseSpark.java +++ b/component-runtime-testing/component-runtime-testing-spark/src/main/java/org/talend/sdk/component/runtime/testing/spark/internal/BaseSpark.java @@ -243,6 +243,44 @@ private File buildSparkHome(final Version version) { } }); + // Align jackson-core with jackson-databind that Spark depends on. + // Maven dependency mediation lets avro:1.11.x (a nearer transitive) downgrade + // jackson-core to 2.14.3 while spark itself drags jackson-databind 2.15.x, + // producing NoClassDefFoundError: com/fasterxml/jackson/core/StreamReadConstraints + // at driver boot. Resolve jackson-core explicitly at the version chosen for + // jackson-databind so the right jar lands in sparkHome/jars/. + try { + final File databindJar = Stream + .of(libFolder.listFiles((d, name) -> name.startsWith("jackson-databind-"))) + .filter(java.util.Objects::nonNull) + .flatMap(Stream::of) + .findFirst() + .orElse(null); + if (databindJar != null) { + final String dbName = databindJar.getName(); + // jackson-databind-.jar + final String dbVersion = + dbName.substring("jackson-databind-".length(), dbName.length() - ".jar".length()); + final String coreCoord = "com.fasterxml.jackson.core:jackson-core:" + dbVersion; + LOGGER.info("Aligning jackson-core on " + dbVersion + " to match jackson-databind..."); + final File coreFile = resolver.resolve(coreCoord).withoutTransitivity().asSingleFile(); + Files + .copy(coreFile.toPath(), new File(libFolder, coreFile.getName()).toPath(), + StandardCopyOption.REPLACE_EXISTING); + // Drop any older jackson-core jars that may shadow the aligned one in spark/jars/* + final File[] olderCores = libFolder.listFiles((d, name) -> name.startsWith("jackson-core-") + && !name.equals(coreFile.getName())); + if (olderCores != null) { + for (final File f : olderCores) { + LOGGER.info("Removing mismatched jackson-core: " + f.getName()); + f.delete(); + } + } + } + } catch (final Exception e) { + LOGGER.warn("Could not align jackson-core with jackson-databind: " + e.getMessage(), e); + } + // Add logging dependencies separately to ensure they are included Stream .of("org.apache.logging.log4j:log4j-slf4j-impl:" + log4j2Version, diff --git a/component-server-parent/component-server/src/test/java/org/talend/sdk/component/server/lang/MapCacheTest.java b/component-server-parent/component-server/src/test/java/org/talend/sdk/component/server/lang/MapCacheTest.java index 57e07dc681b25..f933ca98d9d02 100644 --- a/component-server-parent/component-server/src/test/java/org/talend/sdk/component/server/lang/MapCacheTest.java +++ b/component-server-parent/component-server/src/test/java/org/talend/sdk/component/server/lang/MapCacheTest.java @@ -22,11 +22,12 @@ import java.util.concurrent.ConcurrentMap; import java.util.stream.Stream; -import org.jspecify.annotations.NonNull; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import lombok.NonNull; + public class MapCacheTest { @ParameterizedTest diff --git a/container/nested-maven-repository/pom.xml b/container/nested-maven-repository/pom.xml index 671324eb3e7a9..b37138b9537fd 100644 --- a/container/nested-maven-repository/pom.xml +++ b/container/nested-maven-repository/pom.xml @@ -29,7 +29,7 @@ ${talend.build.name.base}.container.maven - 3.1.0 + 3.3.0 0.13.1 @@ -82,6 +82,34 @@ org.apache.maven.shared maven-artifact-transfer ${maven-artifact-transfer.version} + + + + org.apache.maven + maven-core + + + org.apache.maven + maven-aether-provider + + + org.sonatype.plexus + plexus-sec-dispatcher + + + org.sonatype.plexus + plexus-cipher + + + org.sonatype.aether + * + + diff --git a/documentation/src/main/frontend/package-lock.json b/documentation/src/main/frontend/package-lock.json index c140772f1d0d8..e3b5807ad3a41 100644 --- a/documentation/src/main/frontend/package-lock.json +++ b/documentation/src/main/frontend/package-lock.json @@ -1,16 +1,18 @@ { "name": "documentation", - "version": "1.94.0-SNAPSHOT", + "version": "1.91.0-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "documentation", - "version": "1.94.0-SNAPSHOT", + "version": "1.91.0-SNAPSHOT", "dependencies": { "@antora/cli": "3.0.3", "@antora/site-generator-default": "3.0.3", + "brace-expansion": "1.1.12", "braces": "3.0.3", + "convict": "6.2.4", "js-search": "1.4.2", "json5": "2.2.2", "minimist": "1.2.6" @@ -386,9 +388,9 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/brace-expansion": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", - "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -625,9 +627,9 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "node_modules/convict": { - "version": "6.2.5", - "resolved": "https://registry.npmjs.org/convict/-/convict-6.2.5.tgz", - "integrity": "sha512-JtXpxqDqJ8P0UwEHwhxLzCIXQy97vlYBZR222Sbzb1q1Erex9ASrztJ29SyhWFQjod1AeFBaPzEEC8YvtZMIYg==", + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/convict/-/convict-6.2.4.tgz", + "integrity": "sha512-qN60BAwdMVdofckX7AlohVJ2x9UvjTNoKVXCL2LxFk1l7757EJqf1nySdMkPQer0bt8kQ5lQiyZ9/2NvrFBuwQ==", "dependencies": { "lodash.clonedeep": "^4.5.0", "yargs-parser": "^20.2.7" @@ -2496,9 +2498,9 @@ "glob-stream": "~7.0", "hpagent": "~0.1.0", "isomorphic-git": "~1.10", - "js-yaml": "^4.1.1", + "js-yaml": "~4.1", "multi-progress": "~4.0", - "picomatch": "^2.3.2", + "picomatch": "~2.3", "progress": "~2.0", "should-proxy": "~1.0", "simple-get": "~4.0", @@ -2565,7 +2567,7 @@ "integrity": "sha512-2zJEQjFrAbOqkVt2qDVyTnw6d/bZrp/yHUmqwUoN7wqG7uPkd/Q0+/Fdfj7loQ4qtKtw9Qy3xtva04vavlkxmw==", "requires": { "@antora/logger": "3.0.3", - "handlebars": "^4.7.9", + "handlebars": "~4.7", "require-from-string": "~2.0" } }, @@ -2576,8 +2578,8 @@ "requires": { "@iarna/toml": "~2.2", "camelcase-keys": "~7.0", - "convict": "^6.2.5", - "js-yaml": "^4.1.1", + "convict": "~6.2", + "js-yaml": "~4.1", "json5": "~2.2" } }, @@ -2647,8 +2649,8 @@ "glob-stream": "~7.0", "gulp-vinyl-zip": "~2.5", "hpagent": "~0.1.0", - "js-yaml": "^4.1.1", - "picomatch": "^2.3.2", + "js-yaml": "~4.1", + "picomatch": "~2.3", "should-proxy": "~1.0", "simple-get": "~4.0", "vinyl": "~2.2" @@ -2748,9 +2750,9 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "brace-expansion": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", - "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2935,9 +2937,9 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "convict": { - "version": "6.2.5", - "resolved": "https://registry.npmjs.org/convict/-/convict-6.2.5.tgz", - "integrity": "sha512-JtXpxqDqJ8P0UwEHwhxLzCIXQy97vlYBZR222Sbzb1q1Erex9ASrztJ29SyhWFQjod1AeFBaPzEEC8YvtZMIYg==", + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/convict/-/convict-6.2.4.tgz", + "integrity": "sha512-qN60BAwdMVdofckX7AlohVJ2x9UvjTNoKVXCL2LxFk1l7757EJqf1nySdMkPQer0bt8kQ5lQiyZ9/2NvrFBuwQ==", "requires": { "lodash.clonedeep": "^4.5.0", "yargs-parser": "^20.2.7" @@ -3178,7 +3180,7 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.1.5", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -3216,7 +3218,7 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.1.5", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -3567,7 +3569,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "requires": { - "brace-expansion": "^1.1.13" + "brace-expansion": "^1.1.7" } }, "minimist": { diff --git a/pom.xml b/pom.xml index c73ac7d95f84a..375f4e0c7116f 100644 --- a/pom.xml +++ b/pom.xml @@ -146,9 +146,9 @@ talend/component-runtime - 17 - 17 - 17 + 21 + 21 + 21 UTF-8 @@ -262,7 +262,7 @@ 3.11.3 3.1.1 3.3.1 - 3.3.0 + 3.6.0 3.21.0 3.3.1 3.5.3 @@ -1232,7 +1232,12 @@ maven-compiler-plugin ${maven-compiler-plugin.version} - true + javac true diff --git a/talend-component-maven-plugin/pom.xml b/talend-component-maven-plugin/pom.xml index 0804c0dbed160..156690b8140ad 100644 --- a/talend-component-maven-plugin/pom.xml +++ b/talend-component-maven-plugin/pom.xml @@ -33,7 +33,7 @@ ${talend.build.name.base}.maven - 2.1.1 + 2.2.0 1.31.1 jdbc