From 8a82c584ae5051ce81d5caac91da2586170700e6 Mon Sep 17 00:00:00 2001 From: Tobias Ortmayr Date: Fri, 5 May 2023 17:03:06 +0200 Subject: [PATCH] GLSP-991: Switch Jenkins build to Java 17 -Remove direct dependency to javax.inject by switching to google.inject counterparts Due to the namespace switch from javax->jakarta with Java17 it's otherwise hard to maintain a build that works for both 11 and 17. -Remove `illegal-access=permit" flag from plugin configuration as it is no longer supported in Java17 -Update maven-shade plugin config to get rid of warnings -Introduce a new orthogonal Java11 compatibility build job that is triggered for every master commit Fixes https://github.com/eclipse-glsp/glsp/issues/991 --- Jenkinsfile | 7 ++++++- .../org.eclipse.glsp.example.workflow/pom.xml | 2 ++ .../src/org/eclipse/glsp/server/di/ClientId.java | 4 ++-- .../org/eclipse/glsp/server/di/DiagramType.java | 6 +++--- pom.xml | 15 --------------- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bf2b079c..7a45b390 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any tools { maven 'apache-maven-latest' - jdk 'openjdk-jdk11-latest' + jdk 'openjdk-jdk17-latest' } environment { @@ -74,6 +74,11 @@ pipeline { } } } + stage('Trigger Java11 build') { + steps { + build wait: false, job: 'glsp-server-java11' + } + } } } } diff --git a/examples/org.eclipse.glsp.example.workflow/pom.xml b/examples/org.eclipse.glsp.example.workflow/pom.xml index 41c3c8a8..0d9cae89 100644 --- a/examples/org.eclipse.glsp.example.workflow/pom.xml +++ b/examples/org.eclipse.glsp.example.workflow/pom.xml @@ -140,6 +140,7 @@ jakarta.websocket:jakarta.websocket-api + javax.websocket:javax.websocket-api log4j:log4j @@ -151,6 +152,7 @@ META-INF/DEPENDENCIES META-INF/ECLIPSE_* META-INF/LICENSE* + META-INF/services/javax.servlet.ServletContainerInitializer META-INF/services/jakarta.servlet.ServletContainerInitializer* META-INF/services/org.eclipse.jetty.webapp.Configuration* META-INF/services/org.eclipse.elk.core.data.ILayoutMetaDataProvider* diff --git a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/ClientId.java b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/ClientId.java index ac663b70..1d47bc6e 100644 --- a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/ClientId.java +++ b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/ClientId.java @@ -23,7 +23,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import javax.inject.Qualifier; +import com.google.inject.BindingAnnotation; /** * Helper annotation that is used for injecting the client id string into classes of diagram session (client session) @@ -37,7 +37,7 @@ * private String diagramType; * */ -@Qualifier @Target({ FIELD, PARAMETER, METHOD }) @Retention(RUNTIME) +@BindingAnnotation public @interface ClientId {} diff --git a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/DiagramType.java b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/DiagramType.java index 924cb076..bd7ea139 100644 --- a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/DiagramType.java +++ b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/DiagramType.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021-2022 EclipseSource and others. + * Copyright (c) 2021-2023 EclipseSource and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -23,7 +23,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import javax.inject.Qualifier; +import com.google.inject.BindingAnnotation; /** * Helper annotation that is used for injecting the diagram type string into classes of diagram session (client session) @@ -38,7 +38,7 @@ * * */ -@Qualifier @Target({ FIELD, PARAMETER, METHOD }) @Retention(RUNTIME) +@BindingAnnotation public @interface DiagramType {} diff --git a/pom.xml b/pom.xml index a6628bd6..e3784745 100644 --- a/pom.xml +++ b/pom.xml @@ -297,11 +297,6 @@ org.apache.maven.plugins maven-source-plugin ${maven.source.version} - - - --illegal-access=permit - - attach-sources @@ -316,21 +311,11 @@ org.apache.maven.plugins maven-surefire-plugin ${maven.surefire.version} - - - --illegal-access=permit - - org.apache.maven.plugins maven-failsafe-plugin ${maven.failsafe.version} - - - --illegal-access=permit - -