From 666ccc9a15c680182549ecbfa2e17e076851e5ec Mon Sep 17 00:00:00 2001 From: Nikolaos Vastardis Date: Mon, 23 Feb 2026 12:04:41 +0000 Subject: [PATCH 1/8] Initial changes for springboot4 upgrade --- pom.xml | 22 +++++++++---------- .../config/SpringSecurityConfig.java | 4 ++-- .../eNav/msgBroker/MessageBrokerTest.java | 2 +- .../controllers/HTMLViewerControllerTest.java | 4 ++-- .../S100PublishControllerTest.java | 6 ++--- src/test/resources/application.properties | 1 - 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index 2281803..d63ba3e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.6 + 4.0.2 @@ -18,7 +18,7 @@ 21 - 2025.0.0 + 2025.1.0 2.8.8 5.3.3 3.7.1 @@ -91,11 +91,11 @@ org.springframework.boot - spring-boot-starter-oauth2-client + spring-boot-starter-security-oauth2-client org.springframework.boot - spring-boot-starter-oauth2-resource-server + spring-boot-starter-security-oauth2-resource-server org.springframework.boot @@ -193,24 +193,22 @@ ${fa.version} + org.springframework.boot spring-boot-starter-test test - - org.springframework.security - spring-security-test + org.springframework.boot + spring-boot-starter-webmvc-test test - - org.springframework.boot - spring-boot-properties-migrator - compile + org.springframework.security + spring-security-test + test - diff --git a/src/main/java/org/grad/eNav/msgBroker/config/SpringSecurityConfig.java b/src/main/java/org/grad/eNav/msgBroker/config/SpringSecurityConfig.java index 4cc1a97..3db0e81 100644 --- a/src/main/java/org/grad/eNav/msgBroker/config/SpringSecurityConfig.java +++ b/src/main/java/org/grad/eNav/msgBroker/config/SpringSecurityConfig.java @@ -24,10 +24,10 @@ import org.grad.eNav.msgBroker.config.mpc.MCPTokenAuthenticationManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest; -import org.springframework.boot.actuate.health.HealthEndpoint; import org.springframework.boot.actuate.info.InfoEndpoint; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.health.actuate.endpoint.HealthEndpoint; +import org.springframework.boot.security.autoconfigure.actuate.web.servlet.EndpointRequest; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/test/java/org/grad/eNav/msgBroker/MessageBrokerTest.java b/src/test/java/org/grad/eNav/msgBroker/MessageBrokerTest.java index 51e9ee1..5c1d19e 100644 --- a/src/test/java/org/grad/eNav/msgBroker/MessageBrokerTest.java +++ b/src/test/java/org/grad/eNav/msgBroker/MessageBrokerTest.java @@ -21,7 +21,7 @@ import org.springframework.context.annotation.Import; import org.springframework.test.context.TestPropertySource; -@SpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @TestPropertySource("classpath:application.properties") @Import(TestingConfiguration.class) class MessageBrokerTest { diff --git a/src/test/java/org/grad/eNav/msgBroker/controllers/HTMLViewerControllerTest.java b/src/test/java/org/grad/eNav/msgBroker/controllers/HTMLViewerControllerTest.java index 9688734..0bf1e5b 100644 --- a/src/test/java/org/grad/eNav/msgBroker/controllers/HTMLViewerControllerTest.java +++ b/src/test/java/org/grad/eNav/msgBroker/controllers/HTMLViewerControllerTest.java @@ -19,8 +19,8 @@ import org.grad.eNav.msgBroker.TestingConfiguration; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest; import org.springframework.context.annotation.Import; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; diff --git a/src/test/java/org/grad/eNav/msgBroker/controllers/S100PublishControllerTest.java b/src/test/java/org/grad/eNav/msgBroker/controllers/S100PublishControllerTest.java index b948038..4c65175 100644 --- a/src/test/java/org/grad/eNav/msgBroker/controllers/S100PublishControllerTest.java +++ b/src/test/java/org/grad/eNav/msgBroker/controllers/S100PublishControllerTest.java @@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration; +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest; import org.springframework.context.annotation.Import; import org.springframework.core.io.ClassPathResource; import org.springframework.integration.channel.PublishSubscribeChannel; @@ -42,7 +42,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -@WebMvcTest(controllers = S100PublishController.class, excludeAutoConfiguration = {SecurityAutoConfiguration.class}) +@WebMvcTest(controllers = S100PublishController.class) @Import(TestingConfiguration.class) class S100PublishControllerTest { diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index d11a697..d8f3736 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -4,7 +4,6 @@ spring.application.name=msg-broker spring.cloud.config.enabled=false # Disable Security while testing -app.security.basic.enabled = false keycloak.enabled=false # Disable Eureka when testing From 67ba81af536d00196151823b4e9195ef65696af4 Mon Sep 17 00:00:00 2001 From: Nikolaos Vastardis Date: Mon, 23 Feb 2026 15:19:03 +0000 Subject: [PATCH 2/8] Minor fixes on the upgraded code --- pom.xml | 2 +- .../eNav/msgBroker/utils/GeometryJSONConverter.java | 2 +- .../grad/eNav/msgBroker/TestingConfiguration.java | 13 +------------ .../controllers/S100PublishControllerTest.java | 2 +- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index d63ba3e..269aa8e 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 21 - 2025.1.0 + 2025.1.1 2.8.8 5.3.3 3.7.1 diff --git a/src/main/java/org/grad/eNav/msgBroker/utils/GeometryJSONConverter.java b/src/main/java/org/grad/eNav/msgBroker/utils/GeometryJSONConverter.java index 8d00bbc..f3cce09 100644 --- a/src/main/java/org/grad/eNav/msgBroker/utils/GeometryJSONConverter.java +++ b/src/main/java/org/grad/eNav/msgBroker/utils/GeometryJSONConverter.java @@ -59,7 +59,7 @@ public static JsonNode convertFromGeometry(Geometry geometry) { * @return the geometry */ public static Geometry convertToGeometry(JsonNode jsonNode) { - if (jsonNode == null || jsonNode.toString() == "null" || jsonNode.asText() == "null") { + if (jsonNode == null || jsonNode.toString() == "null") { return null; } diff --git a/src/test/java/org/grad/eNav/msgBroker/TestingConfiguration.java b/src/test/java/org/grad/eNav/msgBroker/TestingConfiguration.java index 8acb3eb..5a4539f 100755 --- a/src/test/java/org/grad/eNav/msgBroker/TestingConfiguration.java +++ b/src/test/java/org/grad/eNav/msgBroker/TestingConfiguration.java @@ -34,18 +34,7 @@ public class TestingConfiguration { /** - * Feign depends on the Eureka Registration Listener bean so let's mock one - * up. - * - * @return the Eureka Registration Listener bean - */ - @Bean - RegistrationListener registrationListener() { - return mock(RegistrationListener.class); - } - - /** - * MOck a Geomesa Data Store bean so that we pretend we have a connection + * Mock a Geomesa Data Store bean so that we pretend we have a connection * while the actual GS Data Store configuration is not enabled. * * @return the Geomesa Data Store bean diff --git a/src/test/java/org/grad/eNav/msgBroker/controllers/S100PublishControllerTest.java b/src/test/java/org/grad/eNav/msgBroker/controllers/S100PublishControllerTest.java index 4c65175..a915f05 100644 --- a/src/test/java/org/grad/eNav/msgBroker/controllers/S100PublishControllerTest.java +++ b/src/test/java/org/grad/eNav/msgBroker/controllers/S100PublishControllerTest.java @@ -42,7 +42,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -@WebMvcTest(controllers = S100PublishController.class) +@WebMvcTest(controllers = S100PublishController.class, excludeAutoConfiguration = {SecurityAutoConfiguration.class}) @Import(TestingConfiguration.class) class S100PublishControllerTest { From d10f554f7d05d7195d1d60c375d117ebf718423c Mon Sep 17 00:00:00 2001 From: Nikolaos Vastardis Date: Tue, 28 Apr 2026 15:29:08 +0100 Subject: [PATCH 3/8] Minor version updates --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 269aa8e..9d428e3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 4.0.2 + 4.0.6 @@ -25,7 +25,7 @@ 6.5.2 5.4.0 2.13 - 3.9.0 + 3.9.2 From 5d0e3e6a4f6316a32b8b0946767136700f7cd84f Mon Sep 17 00:00:00 2001 From: Nikolaos Vastardis Date: Tue, 28 Apr 2026 15:47:30 +0100 Subject: [PATCH 4/8] Pom restructuring in line with start spring io --- pom.xml | 199 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 131 insertions(+), 68 deletions(-) diff --git a/pom.xml b/pom.xml index 9d428e3..2d7e426 100644 --- a/pom.xml +++ b/pom.xml @@ -6,20 +6,46 @@ org.springframework.boot spring-boot-starter-parent - 4.0.6 + 4.0.5 - org.thls + org.grad message-broker - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT MessageBroker GRAD e-Navigation Message Broker Microservice + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + Free license to use with acknowledgement to GRAD. + + + + + nvasta + Nikolaos Vastardis + Nikolaos.Vastardis@gla-rad.org + https://www.gla-rad.org/sectors/digital-services + GRAD + https://www.gla-rad.org/ + + + l0rro + Lawrence Hughes + Lawrence.Hughes@gla-rad.org + https://www.gla-rad.org/sectors/digital-services + GRAD + https://www.gla-rad.org/ + + 21 2025.1.1 - 2.8.8 + 3.0.2 5.3.3 3.7.1 6.5.2 @@ -32,93 +58,120 @@ org.apache.maven.plugins - maven-deploy-plugin - 3.0.0-M2 + maven-surefire-plugin + + + -javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar + -Xshare:off + + org.springframework.boot spring-boot-maven-plugin - true + + + org.projectlombok + lombok + + - - org.apache.maven.plugins - maven-dependency-plugin - - - - properties - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.5.3 - - -javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar - - + + org.apache.maven.plugins + maven-compiler-plugin + + + default-compile + compile + + compile + + + + + org.projectlombok + lombok + + + + + + default-testCompile + test-compile + + testCompile + + + + + org.projectlombok + lombok + + + + + + - org.springframework.cloud - spring-cloud-starter-config + org.springframework.boot + spring-boot-starter-actuator org.springframework.boot - spring-boot-starter-web + spring-boot-starter-security-oauth2-client org.springframework.boot - spring-boot-starter-validation + spring-boot-starter-security-oauth2-resource-server org.springframework.boot - spring-boot-starter-actuator + spring-boot-starter-thymeleaf - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client + org.springframework.boot + spring-boot-starter-validation org.springframework.boot - spring-boot-starter-security + spring-boot-starter-webflux org.springframework.boot - spring-boot-starter-security-oauth2-client + spring-boot-starter-websocket - org.springframework.boot - spring-boot-starter-security-oauth2-resource-server + org.springframework.cloud + spring-cloud-starter-config - org.springframework.boot - spring-boot-starter-thymeleaf + org.springframework.integration + spring-integration-stomp - org.thymeleaf.extras - thymeleaf-extras-springsecurity6 + org.springframework.integration + spring-integration-webflux - org.springframework.integration - spring-integration-core + spring-integration-websocket - - org.springframework.boot - spring-boot-starter-websocket + org.thymeleaf.extras + thymeleaf-extras-springsecurity6 + - org.projectlombok - lombok + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${springdoc.version} @@ -155,13 +208,6 @@ ${kafka.version} - - - org.springdoc - springdoc-openapi-starter-webmvc-ui - ${springdoc.version} - - org.webjars @@ -196,31 +242,49 @@ org.springframework.boot - spring-boot-starter-test + spring-boot-devtools + runtime + true + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-actuator-test test org.springframework.boot - spring-boot-starter-webmvc-test + spring-boot-starter-thymeleaf-test test - org.springframework.security - spring-security-test + org.springframework.boot + spring-boot-starter-validation-test + test + + + org.springframework.boot + spring-boot-starter-webflux-test + test + + + org.springframework.boot + spring-boot-starter-websocket-test + test + + + org.springframework.integration + spring-integration-test test - - - org.springframework.boot - spring-boot-devtools - runtime - true - - org.springframework.cloud spring-cloud-dependencies @@ -228,7 +292,6 @@ pom import - From 11a53d15211a7ba885f5342e8f471695bf7c8b30 Mon Sep 17 00:00:00 2001 From: Nikolaos Vastardis Date: Tue, 28 Apr 2026 15:50:42 +0100 Subject: [PATCH 5/8] Upgrading to JDK25 --- .github/workflows/maven.yml | 4 ++-- README.md | 2 +- docker/Dockerfile | 8 ++++---- pom.xml | 2 +- src/main/resources/messageBroker.conf | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ed6807f..7a29d97 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 21 + - name: Set up JDK 25 uses: actions/setup-java@v3 with: - java-version: '21' + java-version: '25' distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/README.md b/README.md index 3eb1f42..8feb7fe 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ update the *.gitignore* file appropriately. ## Build Setup -The project is using the latest OpenJDK 21 to build, although earlier versions +The project is using the latest OpenJDK 25 to build, although earlier versions should also work. To build the project you will need Maven, which usually comes along-side the diff --git a/docker/Dockerfile b/docker/Dockerfile index 9350d7f..a08410e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,8 +14,8 @@ # the conf-folder and point to them in application.properties. # -# Use the official OpenJDK 21 image as the base image -FROM eclipse-temurin:21-jre-alpine +# Use the official OpenJDK 25 image as the base image +FROM eclipse-temurin:25-jre-alpine LABEL org.opencontainers.image.source="https://github.com/gla-rad/eNav-MessageBroker" @@ -23,7 +23,7 @@ LABEL org.opencontainers.image.source="https://github.com/gla-rad/eNav-MessageBr WORKDIR /app # Copy the Spring Boot JAR file into the container -COPY target/message-broker-0.0.4-SNAPSHOT.jar . +COPY target/message-broker-0.0.45-SNAPSHOT.jar . # Create a modules path just in case ENV LOADER_PATH /modules @@ -37,4 +37,4 @@ ENV CONFIG_DIR=/conf EXPOSE 8763 -CMD ["java", "-jar", "message-broker-0.0.4-SNAPSHOT.jar", "--spring.config.location=optional:classpath:/,optional:file:${CONFIG_DIR}/"] +CMD ["java", "-jar", "message-broker-0.0.5-SNAPSHOT.jar", "--spring.config.location=optional:classpath:/,optional:file:${CONFIG_DIR}/"] diff --git a/pom.xml b/pom.xml index 2d7e426..801a56b 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ - 21 + 25 2025.1.1 3.0.2 5.3.3 diff --git a/src/main/resources/messageBroker.conf b/src/main/resources/messageBroker.conf index 5ac3f88..8700ab7 100644 --- a/src/main/resources/messageBroker.conf +++ b/src/main/resources/messageBroker.conf @@ -1,2 +1,2 @@ -JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/ +JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64/ JAVA_OPTS=-Xmx1024M \ No newline at end of file From 1d6dd6cd1842da35ca668c2d22b14db807b1f575 Mon Sep 17 00:00:00 2001 From: Nikolaos Vastardis Date: Tue, 28 Apr 2026 15:54:23 +0100 Subject: [PATCH 6/8] Upgrading the webjars --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 801a56b..26a7b57 100644 --- a/pom.xml +++ b/pom.xml @@ -46,9 +46,9 @@ 25 2025.1.1 3.0.2 - 5.3.3 + 5.3.8 3.7.1 - 6.5.2 + 7.2.0 5.4.0 2.13 3.9.2 From d11d04609d6529957b54f43f00b74309b55c56f2 Mon Sep 17 00:00:00 2001 From: Nikolaos Vastardis Date: Tue, 28 Apr 2026 16:02:10 +0100 Subject: [PATCH 7/8] Last configuration updates --- src/main/resources/application.properties | 2 +- src/main/resources/templates/fragments/general.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 189444e..9561814 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,6 @@ server.port=8763 spring.application.name=msg-broker -spring.application.version=0.0.4 +spring.application.version=0.0.5 # The Spring Cloud Discovery Config spring.config.import=optional:configserver:${ENAV_CLOUD_CONFIG_URI} diff --git a/src/main/resources/templates/fragments/general.html b/src/main/resources/templates/fragments/general.html index b1ece72..a3cd065 100644 --- a/src/main/resources/templates/fragments/general.html +++ b/src/main/resources/templates/fragments/general.html @@ -22,7 +22,7 @@ e-Navigation Message Broker - +