From fe00d52ad5778d85e028f820e21936a2d7869d8a Mon Sep 17 00:00:00 2001 From: chaos2418 <> Date: Fri, 3 Dec 2021 17:20:12 +0530 Subject: [PATCH 1/4] JAVA-8736: update JDK version for the jdk9-and-above Jenkins jobs --- core-java-modules/core-java-11-2/pom.xml | 1 + core-java-modules/core-java-11/pom.xml | 2 ++ .../core-java-time-measurements/pom.xml | 16 ++++++++-------- .../com/baeldung/time/InstantUnitTest.java | 19 +++++++------------ .../baeldung/time/LocalDateTimeUnitTest.java | 7 ------- quarkus-vs-springboot/spring-project/pom.xml | 2 +- 6 files changed, 19 insertions(+), 28 deletions(-) diff --git a/core-java-modules/core-java-11-2/pom.xml b/core-java-modules/core-java-11-2/pom.xml index 332b24ff2e..757c1c0772 100644 --- a/core-java-modules/core-java-11-2/pom.xml +++ b/core-java-modules/core-java-11-2/pom.xml @@ -12,6 +12,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../pom.xml diff --git a/core-java-modules/core-java-11/pom.xml b/core-java-modules/core-java-11/pom.xml index fc61e373ec..1fa5ae2b45 100644 --- a/core-java-modules/core-java-11/pom.xml +++ b/core-java-modules/core-java-11/pom.xml @@ -13,6 +13,8 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + + ../../pom.xml diff --git a/core-java-modules/core-java-time-measurements/pom.xml b/core-java-modules/core-java-time-measurements/pom.xml index e2924b5278..28959d0938 100644 --- a/core-java-modules/core-java-time-measurements/pom.xml +++ b/core-java-modules/core-java-time-measurements/pom.xml @@ -38,15 +38,15 @@ ${asspectj.version} - org.powermock - powermock-module-junit4 - ${powermock.version} + org.mockito + mockito-inline + ${mockito-inline.version} test - org.powermock - powermock-api-mockito2 - ${powermock.version} + org.mockito + mockito-core + ${mockito-inline.version} test @@ -82,10 +82,10 @@ 3.6.1 2.10 - 1.18.12 + 1.18.22 1.8.9 - 2.0.7 1.44 + 4.0.0 \ No newline at end of file diff --git a/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantUnitTest.java b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantUnitTest.java index 608199197a..ba1821b1ce 100644 --- a/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantUnitTest.java +++ b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/InstantUnitTest.java @@ -1,20 +1,15 @@ package com.baeldung.time; import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; +import org.mockito.MockedStatic; import java.time.Clock; import java.time.Instant; import java.time.ZoneId; import static org.assertj.core.api.Assertions.assertThat; -import static org.powermock.api.mockito.PowerMockito.mockStatic; -import static org.powermock.api.mockito.PowerMockito.when; +import static org.mockito.Mockito.mockStatic; -@RunWith(PowerMockRunner.class) -@PrepareForTest({ Instant.class }) public class InstantUnitTest { @Test @@ -22,12 +17,12 @@ public class InstantUnitTest { String instantExpected = "2014-12-22T10:15:30Z"; Clock clock = Clock.fixed(Instant.parse(instantExpected), ZoneId.of("UTC")); Instant instant = Instant.now(clock); - mockStatic(Instant.class); - when(Instant.now()).thenReturn(instant); - Instant now = Instant.now(); - - assertThat(now.toString()).isEqualTo(instantExpected); + try (MockedStatic mockedStatic = mockStatic(Instant.class)) { + mockedStatic.when(Instant::now).thenReturn(instant); + Instant now = Instant.now(); + assertThat(now.toString()).isEqualTo(instantExpected); + } } @Test diff --git a/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java index 52dc9ba1c6..e4401d67b7 100644 --- a/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java +++ b/core-java-modules/core-java-time-measurements/src/test/java/com/baeldung/time/LocalDateTimeUnitTest.java @@ -1,9 +1,6 @@ package com.baeldung.time; import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; import java.time.Clock; import java.time.Instant; @@ -11,11 +8,7 @@ import java.time.LocalDateTime; import java.time.ZoneId; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.when; -import static org.powermock.api.mockito.PowerMockito.mockStatic; -@RunWith(PowerMockRunner.class) -@PrepareForTest({ LocalDateTime.class }) public class LocalDateTimeUnitTest { @Test diff --git a/quarkus-vs-springboot/spring-project/pom.xml b/quarkus-vs-springboot/spring-project/pom.xml index 128966c07e..ad841a4c0f 100644 --- a/quarkus-vs-springboot/spring-project/pom.xml +++ b/quarkus-vs-springboot/spring-project/pom.xml @@ -166,7 +166,7 @@ 11 - 0.10.3 + 0.10.5 \ No newline at end of file From fdadff3a517add0813b4be752b3168f2f7cc4801 Mon Sep 17 00:00:00 2001 From: chaos2418 <> Date: Sat, 4 Dec 2021 10:00:10 +0530 Subject: [PATCH 2/4] JAVA-8736: fixing plugin versions in core-java-11-2 to work with JDK 17 --- core-java-modules/core-java-11-2/pom.xml | 20 ++++--------------- .../soap/ws/client/generated/Country.java | 8 ++++---- .../ws/client/generated/CountryService.java | 18 ++++++++--------- .../generated/CountryServiceImplService.java | 16 +++++++-------- .../soap/ws/client/generated/Currency.java | 5 ++--- .../ws/client/generated/ObjectFactory.java | 2 +- .../ws/client/generated/package-info.java | 2 +- 7 files changed, 29 insertions(+), 42 deletions(-) diff --git a/core-java-modules/core-java-11-2/pom.xml b/core-java-modules/core-java-11-2/pom.xml index 757c1c0772..fac23f9bfd 100644 --- a/core-java-modules/core-java-11-2/pom.xml +++ b/core-java-modules/core-java-11-2/pom.xml @@ -36,18 +36,6 @@ jakarta.xml.ws-api ${jakarta.ws-api.version} - - com.sun.xml.ws - jaxws-rt - ${jaxws-rt.version} - runtime - - - com.sun.xml.ws - jaxws-ri - ${jaxws-ri.version} - pom - @@ -83,10 +71,10 @@ 11 29.0-jre 5.11.1 - 3.0.0 - 3.0.0 - 2.3.1 - 2.3.2 + 3.0.1 + 3.0.2 + 3.0.2 + 3.0.2 \ No newline at end of file diff --git a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/Country.java b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/Country.java index 950d588661..d39f333b41 100644 --- a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/Country.java +++ b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/Country.java @@ -1,10 +1,10 @@ package com.baeldung.soap.ws.client.generated; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlSchemaType; +import jakarta.xml.bind.annotation.XmlType; /** diff --git a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java index 807d152cf1..f10dcade1b 100644 --- a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java +++ b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java @@ -1,19 +1,19 @@ package com.baeldung.soap.ws.client.generated; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebResult; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.ws.Action; +import jakarta.jws.WebMethod; +import jakarta.jws.WebParam; +import jakarta.jws.WebResult; +import jakarta.jws.WebService; +import jakarta.jws.soap.SOAPBinding; +import jakarta.xml.bind.annotation.XmlSeeAlso; +import jakarta.xml.ws.Action; /** * This class was generated by the JAX-WS RI. - * JAX-WS RI 2.3.2 - * Generated source version: 2.2 + * JAX-WS RI 3.0.2 + * Generated source version: 3.0 * */ @WebService(name = "CountryService", targetNamespace = "http://server.ws.soap.baeldung.com/") diff --git a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java index 97d6c82145..ae7ff38f7d 100644 --- a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java +++ b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java @@ -4,17 +4,17 @@ package com.baeldung.soap.ws.client.generated; import java.net.MalformedURLException; import java.net.URL; import javax.xml.namespace.QName; -import javax.xml.ws.Service; -import javax.xml.ws.WebEndpoint; -import javax.xml.ws.WebServiceClient; -import javax.xml.ws.WebServiceException; -import javax.xml.ws.WebServiceFeature; +import jakarta.xml.ws.Service; +import jakarta.xml.ws.WebEndpoint; +import jakarta.xml.ws.WebServiceClient; +import jakarta.xml.ws.WebServiceException; +import jakarta.xml.ws.WebServiceFeature; /** * This class was generated by the JAX-WS RI. - * JAX-WS RI 2.3.2 - * Generated source version: 2.2 + * JAX-WS RI 3.0.2 + * Generated source version: 3.0 * */ @WebServiceClient(name = "CountryServiceImplService", targetNamespace = "http://server.ws.soap.baeldung.com/", wsdlLocation = "http://localhost:8888/ws/country?wsdl") @@ -75,7 +75,7 @@ public class CountryServiceImplService /** * * @param features - * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * A list of {@link jakarta.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. * @return * returns CountryService */ diff --git a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java index c010f5533c..ad42c65461 100644 --- a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java +++ b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java @@ -1,15 +1,14 @@ package com.baeldung.soap.ws.client.generated; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlEnum; +import jakarta.xml.bind.annotation.XmlType; /** *

Java class for currency. * *

The following schema fragment specifies the expected content contained within this class. - *

*

  * <simpleType name="currency">
  *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
diff --git a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java
index 9ed85fe2b9..0489e49c2b 100644
--- a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java
+++ b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java
@@ -1,7 +1,7 @@
 
 package com.baeldung.soap.ws.client.generated;
 
-import javax.xml.bind.annotation.XmlRegistry;
+import jakarta.xml.bind.annotation.XmlRegistry;
 
 
 /**
diff --git a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java
index dfc556859f..6dcc08c268 100644
--- a/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java
+++ b/core-java-modules/core-java-11-2/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java
@@ -1,2 +1,2 @@
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://server.ws.soap.baeldung.com/")
+@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://server.ws.soap.baeldung.com/")
 package com.baeldung.soap.ws.client.generated;

From 77c7b12b20801c883b46516b75bd4dfada96a67d Mon Sep 17 00:00:00 2001
From: chaos2418 <>
Date: Sat, 4 Dec 2021 10:33:19 +0530
Subject: [PATCH 3/4] JAVA-8736: updating spring-aot-maven-plugin version in
 sprng-project to be compatible with JDK 17

---
 quarkus-vs-springboot/spring-project/pom.xml | 22 ++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/quarkus-vs-springboot/spring-project/pom.xml b/quarkus-vs-springboot/spring-project/pom.xml
index ad841a4c0f..989e30526f 100644
--- a/quarkus-vs-springboot/spring-project/pom.xml
+++ b/quarkus-vs-springboot/spring-project/pom.xml
@@ -10,7 +10,7 @@
     
         org.springframework.boot
         spring-boot-starter-parent
-        2.5.4
+        2.6.0
         
     
 
@@ -96,6 +96,15 @@
                 false
             
         
+        
+        
+            spring-milestones
+            Spring Milestones
+            https://repo.spring.io/libs-milestone-local
+            
+                false
+            
+        
     
     
         
@@ -106,6 +115,15 @@
                 false
             
         
+        
+        
+            spring-milestones
+            Spring Milestones
+            https://repo.spring.io/libs-milestone-local
+            
+                false
+            
+        
     
 
     
@@ -166,7 +184,7 @@
     
         11
         
-        0.10.5
+        0.11.0-RC1
     
 
 
\ No newline at end of file

From c43b11c0f5107756f6786076bfc52bd54756555b Mon Sep 17 00:00:00 2001
From: chaos2418 <>
Date: Mon, 6 Dec 2021 14:54:20 +0530
Subject: [PATCH 4/4] JAVA-8736: removing unused jaxws* properties

---
 core-java-modules/core-java-11-2/pom.xml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/core-java-modules/core-java-11-2/pom.xml b/core-java-modules/core-java-11-2/pom.xml
index fac23f9bfd..b077373448 100644
--- a/core-java-modules/core-java-11-2/pom.xml
+++ b/core-java-modules/core-java-11-2/pom.xml
@@ -72,8 +72,6 @@
         29.0-jre
         5.11.1
         3.0.1
-        3.0.2
-        3.0.2
         3.0.2