Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(TCOMP-1914) re-opened jdk17 target java 17 #987

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a6a24e9
feat(TCOMP-1914): bump build related plugins
undx Oct 15, 2024
2d756fd
Merge branch 'refs/heads/master' into undx/TCOMP-1914-jdk17
undx Oct 16, 2024
1501576
feat(TCOMP-1914): remove bom
undx Oct 16, 2024
da01f98
feat(TCOMP-1914): fix build errors and warnings
undx Oct 16, 2024
8cdacd9
feat(TCOMP-1914): fix OptionParameterValidator test
undx Oct 16, 2024
0be3f62
feat(TCOMP-1914): bump maven version in docker env
undx Oct 16, 2024
cc51263
feat(TCOMP-1914): bump maven to 3.9.0 in docker env
undx Oct 16, 2024
f5d861c
feat(TCOMP-1914): removed provided scope for it
undx Oct 17, 2024
4111216
feat(TCOMP-1914): try to fix variatic test results (local/ci)
undx Oct 17, 2024
250146a
feat(TCOMP-1914): debug groovy issue
undx Oct 17, 2024
a630a4c
feat(TCOMP-1914): debug groovy issue step 2
undx Oct 17, 2024
e6e4cc2
feat(TCOMP-1914): debug groovy issue step 2
undx Oct 17, 2024
5d6b9d5
feat(TCOMP-1914): groovy move to official wrapper
undx Oct 17, 2024
be09af2
feat(TCOMP-1914): bump maven to 3.9.9 for fixing npe when no pom
undx Oct 17, 2024
500e87c
feat(TCOMP-1914): cleanup groovy script
undx Oct 17, 2024
c5e5958
Merge branch 'master' into undx/TCOMP-1914-jdk17
undx Oct 18, 2024
2c8b88b
Merge branch 'master' into undx/TCOMP-1914-jdk17
Nov 25, 2024
17d157a
Merge branch 'master' into undx/TCOMP-1914-jdk17
Dec 2, 2024
390b1cf
Merge branch 'master' into undx/TCOMP-1914-jdk17
acatoire Jan 2, 2025
c235809
Do not edit version by default
acatoire Jan 2, 2025
0e89c00
Merge branch 'master' into undx/TCOMP-1914-jdk17
undx Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
java adoptopenjdk-17.0.5+8
maven 3.8.8
maven 3.9.9
trivy 0.54.1
17 changes: 11 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ pipeline {
description: 'Force documentation stage for development branches. No effect on master and maintenance.')

string(name: 'JAVA_VERSION',
defaultValue: 'adoptopenjdk-17.0.5+8',
defaultValue: 'from .tool-versions',
description: """Provided java version will be installed with asdf
Examples: adoptopenjdk-11.0.22+7, adoptopenjdk-17.0.11+9
""")

string(name: 'MAVEN_VERSION',
defaultValue: '3.8.8',
defaultValue: 'from .tool-versions',
description: """Provided maven version will be installed with asdf
Examples: 3.8.8, 4.0.0-beta-4
Examples: 3.8.8, 3.9.9, 4.0.0-beta-4
""")

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -250,14 +250,19 @@ pipeline {
}

///////////////////////////////////////////
// edit java version
// edit mvn and java version
///////////////////////////////////////////
script {
echo "edit asdf tool version with version from jenkins param"

asdfTools.edit_version_in_file("$env.WORKSPACE/.tool-versions", 'java', params.JAVA_VERSION)
if (params.JAVA_VERSION != 'from .tool-versions') {
asdfTools.edit_version_in_file("$env.WORKSPACE/.tool-versions", 'java', params.JAVA_VERSION)
}
jenkinsJobTools.job_description_append("Use java version: $params.JAVA_VERSION ")
asdfTools.edit_version_in_file("$env.WORKSPACE/.tool-versions", 'maven', params.MAVEN_VERSION)

if (params.MAVEN_VERSION != 'from .tool-versions') {
asdfTools.edit_version_in_file("$env.WORKSPACE/.tool-versions", 'maven', params.MAVEN_VERSION)
}
jenkinsJobTools.job_description_append("Use maven version: $params.MAVEN_VERSION ")

}
Expand Down
2 changes: 1 addition & 1 deletion component-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc-plugin.version}</version>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<splitindex>true</splitindex>
<linksource>true</linksource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import javax.json.bind.annotation.JsonbPropertyOrder;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* This class is dedicated to Studio's guess schema feature.
Expand All @@ -29,6 +30,7 @@
* See me TCOMP-2342 for more details.
*/
@Data
@EqualsAndHashCode(callSuper = true)
@JsonbPropertyOrder({ "localizedMessage", "message", "stackTrace", "suppressed", "possibleHandleErrorWith" })
public class DiscoverSchemaException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<version>@maven-install-plugin.version@</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>@deploy-plugin.version@</version>
<version>@maven-deploy-plugin.version@</version>
<configuration>
<skip>true</skip>
</configuration>
Expand All @@ -121,7 +121,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>@shade-plugin.version@</version>
<version>@maven-shade-plugin.version@</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.talend.sdk.component.runtime.beam.coder.JsonpJsonObjectCoder;

import lombok.Data;
import lombok.EqualsAndHashCode;

public class ASource extends BoundedSource<JsonObject> {

Expand Down Expand Up @@ -78,6 +79,7 @@ private static void assertClassLoader() {
}

@Data
@EqualsAndHashCode(callSuper = true)
private static class AReader extends BoundedReader<JsonObject> {

private final ASource source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,29 @@ void coerce() {
assertEquals(new Date(1000l), MappingUtils.coerce(Date.class, 1000l, name));
// === non-matching types ===
// number classes mapping
assertEquals(shorty, MappingUtils.coerce(short.class, new Short(shorty), name));
assertEquals(shorty, MappingUtils.coerce(short.class, shorty, name));
assertEquals(shorty, MappingUtils.coerce(Short.class, shorty.shortValue(), name));
assertEquals(Byte.valueOf("123"), MappingUtils.coerce(Byte.class, 123l, name));
assertEquals(Byte.valueOf("123"), MappingUtils.coerce(byte.class, 123l, name));
assertEquals(BigDecimal.valueOf(12345.67891), MappingUtils.coerce(BigDecimal.class, 12345.67891, name));
assertEquals(shorty.intValue(), MappingUtils.coerce(Integer.class, shorty, name));
// ==== mapping primitive <-> Class ====
assertEquals(Boolean.TRUE, MappingUtils.coerce(Boolean.class, true, name));
assertEquals('c', MappingUtils.coerce(char.class, new Character('c'), name));
assertEquals(new Character('c'), MappingUtils.coerce(Character.class, 'c', name));
assertEquals(123, MappingUtils.coerce(int.class, new Integer(123), name));
assertEquals(new Integer(123), MappingUtils.coerce(Integer.class, 123, name));
assertEquals(123l, MappingUtils.coerce(long.class, new Long(123), name));
assertEquals(new Long(123), MappingUtils.coerce(Long.class, 123, name));
assertEquals(123.456f, MappingUtils.coerce(float.class, new Float(123.456), name));
assertEquals(new Float(123.456), MappingUtils.coerce(Float.class, 123.456f, name));
assertEquals(123.456, MappingUtils.coerce(double.class, new Double(123.456), name));
assertEquals(new Double(123.456), MappingUtils.coerce(Double.class, 123.456, name));
assertEquals('c', MappingUtils.coerce(char.class, 'c', name));
assertEquals('c', MappingUtils.coerce(Character.class, 'c', name));
assertEquals(123, MappingUtils.coerce(int.class, 123, name));
assertEquals(123, MappingUtils.coerce(Integer.class, 123, name));
assertEquals(123l, MappingUtils.coerce(long.class, 123l, name));
assertEquals(123l, MappingUtils.coerce(Long.class, 123l, name));
assertEquals(123.456f, MappingUtils.coerce(float.class, 123.456, name));
assertEquals(123.456f, MappingUtils.coerce(Float.class, 123.456f, name));
assertEquals(123.456, MappingUtils.coerce(double.class, 123.456, name));
assertEquals(123.456, MappingUtils.coerce(Double.class, 123.456, name));

assertEquals("1000", MappingUtils.coerce(String.class, 1000l, name));
// string mapping
assertEquals('c', MappingUtils.coerce(char.class, "c", name));
assertEquals(new Character('c'), MappingUtils.coerce(Character.class, "c", name));
assertEquals('c', MappingUtils.coerce(Character.class, "c", name));
assertEquals(Character.MIN_VALUE, MappingUtils.coerce(Character.class, "", name));
assertEquals(true, MappingUtils.coerce(Boolean.class, "true", name));
assertEquals(true, MappingUtils.coerce(boolean.class, "true", name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = PRIVATE)
// as deprecation was introduced since = "17", can ignore it for now...
@SuppressWarnings({ "deprecation", "removal" })
public final class Unsafes {

private static final Object UNSAFE;
Expand Down
52 changes: 51 additions & 1 deletion component-runtime-testing/component-runtime-beam-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-beam</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-inject-plexus</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
Expand All @@ -59,11 +77,43 @@
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-named-locks</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-spi</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-core</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -114,7 +164,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc-plugin.version}</version>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc-plugin.version}</version>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void evaluate() throws Throwable {
new InetSocketAddress("localhost", API.getPort()))));
connection.setConnectTimeout(30000);
connection.setReadTimeout(20000);
connection.setRequestProperty("Accept", "*/*");
connection.setRequestProperty("Accept-Encoding", "gzip");
connection.setRequestProperty("Authorization", "should be filtered");
connection.setRequestProperty("ok", "yes");
Expand All @@ -127,7 +128,7 @@ public void evaluate() throws Throwable {
final String lines = String.join("\n", Files.readAllLines(output));
assertJSONEquals("[\n" + " {\n" + " \"request\":{\n" + " \"headers\":{\n"
+ " \"content-length\":\"0\",\n"
+ " \"Accept\":\"text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\",\n"
+ " \"Accept\":\"*/*\",\n"
+ " \"Accept-Encoding\":\"gzip\",\n" + " \"ok\":\"yes\",\n"
+ " \"Proxy-Connection\":\"keep-alive\"\n" + " },\n" + " \"method\":\"GET\",\n"
+ " \"uri\":\"http://localhost:" + server.getAddress().getPort() + "/supertest\"\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public void evaluate() throws Throwable {
new InetSocketAddress("localhost", API.getPort()))));
connection.setConnectTimeout(30000);
connection.setReadTimeout(20000);
connection.setRequestProperty("Accept", "*/*");
connection.setRequestProperty("Authorization", "should be filtered");
connection.setRequestProperty("ok", "yes");
assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
Expand All @@ -117,7 +118,7 @@ public void evaluate() throws Throwable {
final String lines = String.join("\n", Files.readAllLines(output));
assertJSONEquals("[\n" + " {\n" + " \"request\":{\n" + " \"headers\":{\n"
+ " \"content-length\":\"0\",\n"
+ " \"Accept\":\"text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\",\n"
+ " \"Accept\":\"*/*\",\n"
+ " \"ok\":\"yes\",\n" + " \"Proxy-Connection\":\"keep-alive\"\n" + " },\n"
+ " \"method\":\"GET\",\n" + " \"uri\":\"http://localhost:"
+ server.getAddress().getPort() + "/supertest\"\n" + " },\n" + " \"response\":{\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public void evaluate() throws Throwable {
new InetSocketAddress("localhost", API.getPort()))));
connection.setConnectTimeout(30000);
connection.setReadTimeout(20000);
connection.setRequestProperty("Accept", "*/*");
connection.setHostnameVerifier((h, s) -> true);
connection.setSSLSocketFactory(server.getHttpsConfigurator().getSSLContext().getSocketFactory());
assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
Expand All @@ -135,7 +136,7 @@ public void evaluate() throws Throwable {
final String lines = String.join("\n", Files.readAllLines(output));
assertJSONEquals("[\n" + " {\n" + " \"request\":{\n" + " \"headers\":{\n"
+ " \"content-length\":\"0\",\n"
+ " \"Accept\":\"text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\",\n"
+ " \"Accept\":\"*/*\",\n"
+ " \"Connection\":\"keep-alive\"\n" + " },\n" + " \"method\":\"GET\",\n"
+ " \"uri\":\"https://localhost:" + server.getAddress().getPort() + "/supertest\"\n"
+ " },\n" + " \"response\":{\n" + " \"headers\":{\n"
Expand Down
2 changes: 1 addition & 1 deletion component-runtime-testing/component-runtime-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc-plugin.version}</version>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
3 changes: 2 additions & 1 deletion component-runtime-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@

<properties>
<wagon.version>3.4.0</wagon.version>
<shrinkwrap.version>3.3.1</shrinkwrap.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>3.1.4</version>
<version>${shrinkwrap.version}</version>
<exclusions>
<exclusion>
<groupId>org.jsoup</groupId>
Expand Down
1 change: 0 additions & 1 deletion component-starter-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@
</scripts>
<properties>
<gradleHome>${project.build.directory}/gradle-${gradle.version}</gradleHome>
<mvnVersion>${mvn.version}</mvnVersion>
</properties>
</configuration>
<dependencies>
Expand Down
7 changes: 4 additions & 3 deletions component-starter-server/src/build/GrabMavenWrapper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ def validateWrapperFile(File baseDir, String file){
case "mvnw":
if(!from.text.contains('exec "$JAVACMD" \\\n' +
' $MAVEN_OPTS \\\n' +
' $MAVEN_DEBUG_OPTS \\\n' +
' -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \\\n' +
' "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \\\n' +
' "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \\\n' +
' ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"')){
throw new IllegalStateException("Invalid file: " + file);
}
break
case "mvnw.cmd":
if(!from.text.contains('%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*')){
if(!from.text.contains('%MAVEN_JAVA_EXE% ^')){
throw new IllegalStateException("Invalid file: " + file);
}
break
Expand All @@ -53,7 +54,7 @@ final int exit = new ProcessBuilder().inheritIO()
.directory(fakeProject)
.command(
new File(System.getProperty('maven.home'), "bin/" + mvnCommand).getAbsolutePath(),
"-N", "io.takari:maven:wrapper", "-Dmaven=" + mvnVersion)
"-N", "-Dtype=bin", "wrapper:wrapper")
.start().waitFor()
if (exit != 0) {
throw new IllegalStateException("bad exit status generating maven wrapper: " + exit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
package org.talend.sdk.component.starter.server.service.openapi.model.openapi;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class Header extends Parameter {

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
import org.talend.sdk.component.starter.server.service.openapi.model.common.OperationBase;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* Describes a single API operation on a path.
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class Operation extends OperationBase {

/**
Expand Down
Loading
Loading