Skip to content

Commit c59a1bc

Browse files
jansupolsenivam
authored andcommitted
Build & run with JDK 24
Signed-off-by: jansupol <jan.supol@oracle.com>
1 parent 6c8a209 commit c59a1bc

File tree

11 files changed

+95
-29
lines changed

11 files changed

+95
-29
lines changed

core-common/pom.xml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,9 @@
848848

849849
<profile>
850850
<id>securityOff</id>
851+
<activation>
852+
<jdk>[24,)</jdk>
853+
</activation>
851854
<properties>
852855
<surefire.security.argline />
853856
</properties>
@@ -856,12 +859,17 @@
856859
<plugin>
857860
<groupId>org.apache.maven.plugins</groupId>
858861
<artifactId>maven-surefire-plugin</artifactId>
859-
<configuration>
860-
<excludes>
861-
<exclude>**/SecurityManagerConfiguredTest.java</exclude>
862-
<exclude>**/ReflectionHelperTest.java</exclude>
863-
</excludes>
864-
</configuration>
862+
<executions>
863+
<execution>
864+
<id>default-test</id>
865+
<configuration>
866+
<excludes>
867+
<exclude>**/SecurityManagerConfiguredTest.java</exclude>
868+
<exclude>**/ReflectionHelperTest.java</exclude>
869+
</excludes>
870+
</configuration>
871+
</execution>
872+
</executions>
865873
</plugin>
866874
</plugins>
867875
</build>

core-common/src/test/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactoryTest.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -30,11 +30,14 @@
3030

3131
public class ExternalPropertiesConfigurationFactoryTest {
3232

33+
private static boolean isSecurityManager;
34+
3335
/**
3436
* Predefine some properties to be read from config
3537
*/
3638
@BeforeAll
3739
public static void setUp() {
40+
isSecurityManager = System.getSecurityManager() != null;
3841
System.setProperty(CommonProperties.ALLOW_SYSTEM_PROPERTIES_PROVIDER, Boolean.TRUE.toString());
3942

4043
System.setProperty("jersey.config.server.provider.scanning.recursive", "PASSED");
@@ -53,7 +56,11 @@ public static void tearDown() {
5356
public void readSystemPropertiesTest() {
5457
final Object result =
5558
readExternalPropertiesMap().get("jersey.config.server.provider.scanning.recursive");
56-
Assertions.assertNull(result);
59+
if (isSecurityManager) {
60+
Assertions.assertNull(result);
61+
} else {
62+
Assertions.assertEquals("PASSED", result);
63+
}
5764
Assertions.assertEquals(Boolean.TRUE,
5865
getConfig().isProperty(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE));
5966
Assertions.assertEquals(Boolean.TRUE,
@@ -81,8 +88,11 @@ public void mergePropertiesTest() {
8188
inputProperties.put("org.jersey.microprofile.config.added", "ADDED");
8289
getConfig().mergeProperties(inputProperties);
8390
final Object result = readExternalPropertiesMap().get("jersey.config.server.provider.scanning.recursive");
84-
Assertions.assertNull(result);
85-
Assertions.assertNull(readExternalPropertiesMap().get("org.jersey.microprofile.config.added"));
91+
final Object resultAdded = readExternalPropertiesMap().get("org.jersey.microprofile.config.added");
92+
if (isSecurityManager) {
93+
Assertions.assertNull(result);
94+
Assertions.assertNull(resultAdded);
95+
}
8696
}
8797

8898
}

core-server/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@
270270
</profile>
271271
<profile>
272272
<id>securityOff</id>
273+
<activation>
274+
<jdk>[24,)</jdk>
275+
</activation>
273276
<properties>
274277
<surefire.security.argline />
275278
</properties>

core-server/src/test/java/org/glassfish/jersey/server/internal/inject/ParamConverterDateTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -40,6 +40,8 @@
4040
import static org.junit.jupiter.api.Assertions.assertEquals;
4141

4242
public class ParamConverterDateTest extends AbstractTest {
43+
private final String format = "EEE MMM dd HH:mm:ss Z yyyy";
44+
private final SimpleDateFormat formatter = new SimpleDateFormat(format, new Locale("US"));
4345

4446
@Path("/")
4547
public static class DateResource {
@@ -55,7 +57,7 @@ public String doGet(@QueryParam("d") final Date d) {
5557
public void testDateResource() throws ExecutionException, InterruptedException {
5658
initiateWebApplication(getBinder(), ParamConverterDateTest.DateResource.class);
5759
final ContainerResponse responseContext = getResponseContext(UriBuilder.fromPath("/")
58-
.queryParam("d", new Date()).build().toString());
60+
.queryParam("d", formatter.format(new Date())).build().toString());
5961

6062
assertEquals(200, responseContext.getStatus());
6163
}
@@ -80,8 +82,6 @@ public T fromString(final String value) {
8082
);
8183
}
8284
try {
83-
final String format = "EEE MMM dd HH:mm:ss Z yyyy";
84-
final SimpleDateFormat formatter = new SimpleDateFormat(format, new Locale("US"));
8585
return rawType.cast(formatter.parse(value));
8686
} catch (final ParseException ex) {
8787
throw new ExtractorException(ex);

examples/groovy/pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<plugin>
8484
<groupId>org.codehaus.gmavenplus</groupId>
8585
<artifactId>gmavenplus-plugin</artifactId>
86-
<version>3.0.0</version>
86+
<version>4.0.1</version>
8787
<executions>
8888
<execution>
8989
<id>1</id>
@@ -99,10 +99,12 @@
9999
<goal>removeTestStubs</goal>
100100
<goal>groovydoc</goal>
101101
</goals>
102+
<configuration>
103+
<targetBytecode>11</targetBytecode>
104+
</configuration>
102105
</execution>
103106
</executions>
104107
</plugin>
105-
106108
<plugin>
107109
<groupId>org.apache.maven.plugins</groupId>
108110
<artifactId>maven-antrun-plugin</artifactId>

examples/osgi-helloworld-webapp/pom.xml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,20 @@
2525
<name>jersey-examples-osgi-helloworld-webapp</name>
2626
<packaging>pom</packaging>
2727

28-
<modules>
29-
<module>war-bundle</module>
30-
<module>functional-test</module>
31-
<module>lib-bundle</module>
32-
<module>additional-bundle</module>
33-
<module>alternate-version-bundle</module>
34-
</modules>
35-
3628
<profiles>
29+
<profile>
30+
<id>securityOn</id>
31+
<activation>
32+
<jdk>[1.8,24)</jdk>
33+
</activation>
34+
<modules>
35+
<module>war-bundle</module>
36+
<module>functional-test</module>
37+
<module>lib-bundle</module>
38+
<module>additional-bundle</module>
39+
<module>alternate-version-bundle</module>
40+
</modules>
41+
</profile>
3742
<profile>
3843
<id>pre-release</id>
3944
<build>

examples/pom.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
<!--<module>feed-combiner-java8-webapp</module>-->
7171
<module>freemarker-webapp</module>
7272
<!--<module>flight-mgmt-webapp</module>-->
73-
<module>groovy</module>
7473
<module>helloworld</module>
7574
<module>helloworld-benchmark</module>
7675
<module>helloworld-cdi2-se</module>
@@ -281,5 +280,16 @@
281280
</resource>
282281
</resources>
283282
</build>
283+
<profiles>
284+
<profile>
285+
<id>GROOVY-EXAMPLE</id>
286+
<activation>
287+
<jdk>[11,)</jdk>
288+
</activation>
289+
<modules>
290+
<module>groovy</module>
291+
</modules>
292+
</profile>
293+
</profiles>
284294

285295
</project>

incubator/pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
<module>cdi-inject-weld</module>
4040
<module>declarative-linking</module>
4141
<module>gae-integration</module>
42-
<module>html-json</module>
4342
<module>injectless-client</module>
4443
<module>kryo</module>
4544
<module>open-tracing</module>
@@ -53,4 +52,16 @@
5352
<scope>test</scope>
5453
</dependency>
5554
</dependencies>
55+
56+
<profiles>
57+
<profile>
58+
<id>HTML-JSON-FOR-PRE-JDK24</id>
59+
<activation>
60+
<jdk>[1.8, 24)</jdk>
61+
</activation>
62+
<modules>
63+
<module>html-json</module>
64+
</modules>
65+
</profile>
66+
</profiles>
5667
</project>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@
21832183
<resources.mvn.plugin.version>3.3.1</resources.mvn.plugin.version>
21842184
<shade.mvn.plugin.version>3.6.0</shade.mvn.plugin.version>
21852185
<source.mvn.plugin.version>3.3.1</source.mvn.plugin.version>
2186-
<surefire.mvn.plugin.version>3.3.1</surefire.mvn.plugin.version>
2186+
<surefire.mvn.plugin.version>3.5.2</surefire.mvn.plugin.version>
21872187
<war.mvn.plugin.version>3.4.0</war.mvn.plugin.version>
21882188
<wiremock.mvn.plugin.version>2.11.0</wiremock.mvn.plugin.version>
21892189
<xml.mvn.plugin.version>1.1.0</xml.mvn.plugin.version>
@@ -2209,7 +2209,7 @@
22092209
<findbugs.glassfish.version>1.7</findbugs.glassfish.version>
22102210
<freemarker.version>2.3.33</freemarker.version>
22112211
<gae.version>2.0.29</gae.version>
2212-
<groovy.version>4.0.22</groovy.version>
2212+
<groovy.version>5.0.0-alpha-11</groovy.version>
22132213
<gson.version>2.11.0</gson.version>
22142214
<guava.version>33.3.0-jre</guava.version>
22152215
<hamcrest.version>3.0</hamcrest.version>

tests/integration/microprofile/rest-client/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,15 @@
218218
</plugins>
219219
</build>
220220
</profile>
221+
<profile>
222+
<id>securityOff</id>
223+
<activation>
224+
<jdk>[24,)</jdk>
225+
</activation>
226+
<properties>
227+
<surefire.security.argline />
228+
</properties>
229+
</profile>
221230
</profiles>
222231

223232
<properties>

0 commit comments

Comments
 (0)