diff --git a/etc/jenkins/Jenkinsfile_ci_build b/etc/jenkins/Jenkinsfile_ci_build index f1b405bd70..f7076ca212 100644 --- a/etc/jenkins/Jenkinsfile_ci_build +++ b/etc/jenkins/Jenkinsfile_ci_build @@ -32,12 +32,12 @@ pipeline { ''' } } - stage('JDK 17 ') { + stage('JDK 19 ') { agent { label 'centos-7' } tools { - jdk 'openjdk-jdk17-latest' + jdk 'openjdk-jdk19-latest' maven 'apache-maven-latest' } steps { diff --git a/examples/groovy/pom.xml b/examples/groovy/pom.xml index 2ac5de0aed..76965f890c 100644 --- a/examples/groovy/pom.xml +++ b/examples/groovy/pom.xml @@ -28,7 +28,7 @@ org.apache.groovy groovy-all pom - 4.0.0-alpha-3 + 4.0.4 org.glassfish.jersey.test-framework.providers diff --git a/ext/bean-validation/pom.xml b/ext/bean-validation/pom.xml index 980467e6c3..914251e428 100644 --- a/ext/bean-validation/pom.xml +++ b/ext/bean-validation/pom.xml @@ -57,7 +57,8 @@ org.glassfish.jersey.server.validation.*;version=${project.version} ${jakarta.annotation.osgi.version}, - jakarta.validation.*;resolution:=optional;version="[3,4)", + ${cdi.osgi.version}, + jakarta.validation.*;resolution:=optional;version="${range;[==,4);${jakarta.validation.api.version}}", * diff --git a/ext/cdi/jersey-cdi-rs-inject/pom.xml b/ext/cdi/jersey-cdi-rs-inject/pom.xml index 24c6d471c3..e766bd0773 100644 --- a/ext/cdi/jersey-cdi-rs-inject/pom.xml +++ b/ext/cdi/jersey-cdi-rs-inject/pom.xml @@ -57,6 +57,20 @@ false + + org.apache.felix + maven-bundle-plugin + true + true + + + + ${cdi.osgi.version}, + * + + + + diff --git a/ext/cdi/jersey-cdi1x-servlet/pom.xml b/ext/cdi/jersey-cdi1x-servlet/pom.xml index 2342ea19e7..c476fdb740 100644 --- a/ext/cdi/jersey-cdi1x-servlet/pom.xml +++ b/ext/cdi/jersey-cdi1x-servlet/pom.xml @@ -86,6 +86,10 @@ org.glassfish.jersey.ext.cdi1x.servlet.internal + + ${cdi.osgi.version}, + * + diff --git a/ext/cdi/jersey-cdi1x-transaction/pom.xml b/ext/cdi/jersey-cdi1x-transaction/pom.xml index b882baaf4b..d09e336cd1 100644 --- a/ext/cdi/jersey-cdi1x-transaction/pom.xml +++ b/ext/cdi/jersey-cdi1x-transaction/pom.xml @@ -37,7 +37,7 @@ jakarta.platform jakarta.jakartaee-api - 9.0.0-RC2 + 9.0.0 provided @@ -91,7 +91,11 @@ org.glassfish.jersey.ext.cdi1x.transaction.internal - ${jakarta.annotation.osgi.version},* + + ${jakarta.annotation.osgi.version}, + ${cdi.osgi.version}, + * + diff --git a/ext/cdi/jersey-cdi1x-validation/pom.xml b/ext/cdi/jersey-cdi1x-validation/pom.xml index 7aba90ec63..020f804bb4 100644 --- a/ext/cdi/jersey-cdi1x-validation/pom.xml +++ b/ext/cdi/jersey-cdi1x-validation/pom.xml @@ -103,7 +103,11 @@ org.glassfish.jersey.ext.cdi1x.validation.internal;version=${project.version} - ${jakarta.annotation.osgi.version},* + + ${jakarta.annotation.osgi.version}, + ${cdi.osgi.version}, + * + diff --git a/ext/cdi/jersey-cdi1x/pom.xml b/ext/cdi/jersey-cdi1x/pom.xml index f51b1b19ad..874234ff8f 100644 --- a/ext/cdi/jersey-cdi1x/pom.xml +++ b/ext/cdi/jersey-cdi1x/pom.xml @@ -87,6 +87,7 @@ ${jakarta.annotation.osgi.version}, ${hk2.osgi.version}, + ${cdi.osgi.version}, * diff --git a/ext/microprofile/mp-rest-client/pom.xml b/ext/microprofile/mp-rest-client/pom.xml index 025f127bf7..c85a4b0ff9 100644 --- a/ext/microprofile/mp-rest-client/pom.xml +++ b/ext/microprofile/mp-rest-client/pom.xml @@ -112,7 +112,7 @@ org.glassfish.jersey.microprofile.restclient.*;version=${project.version} - jakarta.enterprise.*;version="[3.0,5)", + ${cdi.osgi.version}, jakarta.decorator.*;version="[3.0,5)", org.eclipse.microprofile.config.*;version="!", * diff --git a/incubator/cdi-inject-weld/pom.xml b/incubator/cdi-inject-weld/pom.xml index b36d1dabce..331b92f17e 100644 --- a/incubator/cdi-inject-weld/pom.xml +++ b/incubator/cdi-inject-weld/pom.xml @@ -123,7 +123,8 @@ sun.misc.*;resolution:=optional, - ${jakarta.annotation.osgi.version}, + ${cdi.osgi.version}, + ${javax.annotation.osgi.version}, * diff --git a/inject/cdi2-se/pom.xml b/inject/cdi2-se/pom.xml index f740a9ca26..77e227088e 100644 --- a/inject/cdi2-se/pom.xml +++ b/inject/cdi2-se/pom.xml @@ -91,6 +91,7 @@ sun.misc.*;resolution:=optional, + ${cdi.osgi.version}, ${jakarta.annotation.osgi.version}, * diff --git a/pom.xml b/pom.xml index 4a58948313..eda140e8fa 100644 --- a/pom.xml +++ b/pom.xml @@ -1438,7 +1438,7 @@ Jersey ${jersey.version} API Documentation Jersey ${jersey.version} API - Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.]]> @@ -2221,6 +2221,7 @@ 6.2.5 3.0.0 + javax.enterprise.*;version="[3.0,5)" 4.0.1 3.0.1 2.0.0 diff --git a/tests/integration/cdi-integration/gf-cdi-inject/arquillian.xml b/tests/integration/cdi-integration/gf-cdi-inject/arquillian.xml new file mode 100644 index 0000000000..edfddfb4b5 --- /dev/null +++ b/tests/integration/cdi-integration/gf-cdi-inject/arquillian.xml @@ -0,0 +1,30 @@ + + + + + + + true + + + + \ No newline at end of file diff --git a/tests/integration/cdi-integration/gf-cdi-inject/pom.xml b/tests/integration/cdi-integration/gf-cdi-inject/pom.xml new file mode 100644 index 0000000000..7228461549 --- /dev/null +++ b/tests/integration/cdi-integration/gf-cdi-inject/pom.xml @@ -0,0 +1,367 @@ + + + + + 4.0.0 + + org.glassfish.jersey.tests.integration.cdi + cdi-integration-project + 3.0.99-SNAPSHOT + + + gf-cdi-inject-on-server + jersey-tests-glassfish-inject-on-server + + Embedded GF tests @Inject + + + ${project.build.directory}/glassfish6 + ${glassfish.home}/glassfish/modules + ${gf.impl.version} + ${junit5.version} + + + + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + test + + + + org.jboss.arquillian.container + arquillian-glassfish-managed-6 + 1.0.0.Alpha1 + + + + + jakarta.ws.rs + jakarta.ws.rs-api + + + + org.hamcrest + hamcrest + test + + + + org.glassfish.main.common + simple-glassfish-api + ${glassfish.container.version} + test + + + + org.jboss.arquillian.junit5 + arquillian-junit5-container + 1.7.0.Alpha10 + test + + + + org.glassfish.jersey.core + jersey-server + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + process-test-classes + + unpack + + + + + org.glassfish.main.distributions + glassfish + ${gf.impl.version} + zip + false + ${project.build.directory} + + + + + + copy + process-test-classes + + copy + + + + + org.glassfish.jersey.ext + jersey-bean-validation + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-bean-validation.jar + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-cdi1x.jar + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x-servlet + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-cdi1x-servlet.jar + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x-transaction + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-cdi1x-transaction.jar + + + org.glassfish.jersey.ext.cdi + jersey-cdi-rs-inject + ${jersey.version} + jar + ${glassfish.home}/glassfish/modules + jersey-cdi-rs-inject.jar + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-client.jar + + + org.glassfish.jersey.core + jersey-common + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-common.jar + + + org.glassfish.jersey.containers + jersey-container-grizzly2-http + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-container-grizzly2-http.jar + + + org.glassfish.jersey.containers + jersey-container-servlet + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-container-servlet.jar + + + org.glassfish.jersey.containers + jersey-container-servlet-core + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-container-servlet-core.jar + + + org.glassfish.jersey.ext + jersey-entity-filtering + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-entity-filtering.jar + + + org.glassfish.jersey.containers.glassfish + jersey-gf-ejb + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-gf-ejb.jar + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-hk2.jar + + + org.glassfish.jersey.media + jersey-media-jaxb + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-media-jaxb.jar + + + org.glassfish.jersey.media + jersey-media-json-binding + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-media-json-binding.jar + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-media-json-jackson.jar + + + org.glassfish.jersey.media + jersey-media-json-processing + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-media-json-processing.jar + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-media-multipart.jar + + + org.glassfish.jersey.media + jersey-media-sse + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-media-sse.jar + + + org.glassfish.jersey.ext.microprofile + jersey-mp-rest-client + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-mp-rest-client.jar + + + org.glassfish.jersey.ext + jersey-mvc + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-mvc.jar + + + org.glassfish.jersey.ext + jersey-mvc-jsp + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-mvc-jsp.jar + + + org.glassfish.jersey.ext + jersey-proxy-client + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-proxy-client.jar + + + org.glassfish.jersey.core + jersey-server + ${jersey.version} + jar + true + ${glassfish.home}/glassfish/modules + jersey-server.jar + + + jakarta.ws.rs + jakarta.ws.rs-api + jar + true + ${glassfish.home}/glassfish/modules + jakarta.ws.rs-api.jar + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/GFTest.java + + org.glassfish.jersey.tests.integration.cdi:gf-cdi-inject-on-server + + ${glassfish.home} + 8080 + true + + + ${glassfish.home} + + + + + + \ No newline at end of file diff --git a/tests/integration/cdi-integration/gf-cdi-inject/src/main/java/org/glassfish/jersey/tests/cdi/gf/GFTestApp.java b/tests/integration/cdi-integration/gf-cdi-inject/src/main/java/org/glassfish/jersey/tests/cdi/gf/GFTestApp.java new file mode 100644 index 0000000000..116e9230db --- /dev/null +++ b/tests/integration/cdi-integration/gf-cdi-inject/src/main/java/org/glassfish/jersey/tests/cdi/gf/GFTestApp.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.jersey.tests.cdi.gf; + +import org.glassfish.jersey.CommonProperties; +import org.glassfish.jersey.server.ResourceConfig; + +import jakarta.ws.rs.ApplicationPath; + +@ApplicationPath("/test") +public class GFTestApp extends ResourceConfig { + public GFTestApp() { + super(GFTestResource.class); + property(CommonProperties.PROVIDER_DEFAULT_DISABLE, "ALL"); + } +} diff --git a/tests/integration/cdi-integration/gf-cdi-inject/src/main/java/org/glassfish/jersey/tests/cdi/gf/GFTestResource.java b/tests/integration/cdi-integration/gf-cdi-inject/src/main/java/org/glassfish/jersey/tests/cdi/gf/GFTestResource.java new file mode 100644 index 0000000000..2664778257 --- /dev/null +++ b/tests/integration/cdi-integration/gf-cdi-inject/src/main/java/org/glassfish/jersey/tests/cdi/gf/GFTestResource.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.jersey.tests.cdi.gf; + +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.UriInfo; + +@Path("/") +public class GFTestResource { + @Inject + UriInfo uriInfo; + + @GET + @Path("info") + @Produces(MediaType.TEXT_PLAIN) + public String info() { + return uriInfo.getBaseUri().toASCIIString(); + } +} diff --git a/tests/integration/cdi-integration/gf-cdi-inject/src/test/java/org/glassfish/jersey/tests/cdi/gf/GFTest.java b/tests/integration/cdi-integration/gf-cdi-inject/src/test/java/org/glassfish/jersey/tests/cdi/gf/GFTest.java new file mode 100644 index 0000000000..fc3ea3a003 --- /dev/null +++ b/tests/integration/cdi-integration/gf-cdi-inject/src/test/java/org/glassfish/jersey/tests/cdi/gf/GFTest.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package org.glassfish.jersey.tests.cdi.gf; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.core.Response; +import java.io.IOException; + +@ExtendWith(ArquillianExtension.class) +public class GFTest { + @Deployment(testable = false) + public static WebArchive createDeployment() throws IOException { + return createDeployment( + "gf-test", + GFTestApp.class, + GFTestResource.class + ); + } + + private static WebArchive createDeployment(String archiveName, Class...classes) { + WebArchive archive = ShrinkWrap.create(WebArchive.class, archiveName + ".war"); + archive.addClasses(classes); + return archive; + } + + @Test + public void testUriInfo() { + int port = Integer.parseInt(System.getProperty("webServerPort")); + try (Response response = ClientBuilder.newClient().target("http://localhost:" + port).path("gf-test/test/info").request().get()) { + String entity = response.readEntity(String.class); + System.out.println(entity); + Assertions.assertEquals(200, response.getStatus()); + Assertions.assertTrue(entity.contains("gf-test/test")); + } + } +} diff --git a/tests/integration/cdi-integration/pom.xml b/tests/integration/cdi-integration/pom.xml index dc9172c49d..c14ab61cf3 100644 --- a/tests/integration/cdi-integration/pom.xml +++ b/tests/integration/cdi-integration/pom.xml @@ -61,4 +61,15 @@ + + + gf-inject + + [11,) + + + gf-cdi-inject + + + diff --git a/tests/integration/property-check/pom.xml b/tests/integration/property-check/pom.xml index f98c25cee9..1d1ca19b1d 100644 --- a/tests/integration/property-check/pom.xml +++ b/tests/integration/property-check/pom.xml @@ -110,4 +110,28 @@ + + + + jdk19+ + + [19,) + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/SystemPropertiesConfigurationModelTest.java + + + + + + + +