From c045a01687ac94c4d22a5996f6cc3d0332293a76 Mon Sep 17 00:00:00 2001 From: petruki <31597636+petruki@users.noreply.github.com> Date: Sat, 15 Nov 2025 16:13:13 -0800 Subject: [PATCH] Migrated to Java 25, Springboot 3.5.7 --- .github/workflows/tf-identity.yml | 4 +- .github/workflows/tf-management.yml | 4 +- .github/workflows/tf-session.yml | 4 +- README.md | 4 +- pom.xml | 20 ++++++-- trackerforce-common/pom.xml | 2 +- .../common/config/ConfigProperties.java | 35 ------------- .../common/config/OpenAPIConfiguration.java | 24 ++++----- .../common/config/ServiceConfig.java | 27 ++++++++++ .../TrackerforceIdentityApplication.java | 2 + .../TrackerforceManagementApplication.java | 6 ++- trackerforce-session/pom.xml | 2 +- .../TrackerforceSessionApplication.java | 6 ++- .../src/main/resources/snapshots/default.json | 50 +++++++++---------- 14 files changed, 100 insertions(+), 90 deletions(-) delete mode 100644 trackerforce-common/src/main/java/com/trackerforce/common/config/ConfigProperties.java create mode 100644 trackerforce-common/src/main/java/com/trackerforce/common/config/ServiceConfig.java diff --git a/.github/workflows/tf-identity.yml b/.github/workflows/tf-identity.yml index 70203be..a2e1421 100644 --- a/.github/workflows/tf-identity.yml +++ b/.github/workflows/tf-identity.yml @@ -24,10 +24,10 @@ jobs: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Set up JDK 21 + - name: Set up JDK 25 uses: actions/setup-java@v5 with: - java-version: 21 + java-version: 25 distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/.github/workflows/tf-management.yml b/.github/workflows/tf-management.yml index 9c9ed95..cfa8176 100644 --- a/.github/workflows/tf-management.yml +++ b/.github/workflows/tf-management.yml @@ -26,10 +26,10 @@ jobs: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Set up JDK 21 + - name: Set up JDK 25 uses: actions/setup-java@v5 with: - java-version: 21 + java-version: 25 distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/.github/workflows/tf-session.yml b/.github/workflows/tf-session.yml index 5b55544..4da9222 100644 --- a/.github/workflows/tf-session.yml +++ b/.github/workflows/tf-session.yml @@ -26,10 +26,10 @@ jobs: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Set up JDK 21 + - name: Set up JDK 25 uses: actions/setup-java@v5 with: - java-version: 21 + java-version: 25 distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/README.md b/README.md index 00db3fc..918564e 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ For the Global Service: **Requirements** - MongoDB -- Java 21 -- Maven 3.9 +- Java 25 +- Maven 3.11 Run the services indicated by the module name: ``` diff --git a/pom.xml b/pom.xml index ddf0699..3d227f9 100644 --- a/pom.xml +++ b/pom.xml @@ -24,23 +24,23 @@ org.springframework.boot spring-boot-starter-parent - 3.5.6 + 3.5.7 - 21 + 25 ${java.version} ${java.version} - 3.18.0 + 3.19.0 4.21.0 - 3.14.0 + 3.14.1 5.2.0.4988 - 0.8.13 + 0.8.14 jacoco @@ -97,6 +97,16 @@ org.apache.maven.plugins maven-compiler-plugin ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + org.projectlombok + lombok + + + org.sonarsource.scanner.maven diff --git a/trackerforce-common/pom.xml b/trackerforce-common/pom.xml index 02a6937..ee09e6a 100644 --- a/trackerforce-common/pom.xml +++ b/trackerforce-common/pom.xml @@ -29,7 +29,7 @@ 0.13.0 - 2.8.13 + 2.8.14 diff --git a/trackerforce-common/src/main/java/com/trackerforce/common/config/ConfigProperties.java b/trackerforce-common/src/main/java/com/trackerforce/common/config/ConfigProperties.java deleted file mode 100644 index 05ab6cc..0000000 --- a/trackerforce-common/src/main/java/com/trackerforce/common/config/ConfigProperties.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.trackerforce.common.config; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -@Configuration -@ConfigurationProperties(prefix = "service.docs") -@Getter -@Setter -public class ConfigProperties { - - private String title; - private String description; - private String version; - private String url; - private License license; - private Contact contact; - - @Getter - @Setter - public static class License { - private String type; - private String url; - } - - @Getter - @Setter - public static class Contact { - private String author; - private String email; - } - -} diff --git a/trackerforce-common/src/main/java/com/trackerforce/common/config/OpenAPIConfiguration.java b/trackerforce-common/src/main/java/com/trackerforce/common/config/OpenAPIConfiguration.java index 12cfd1e..d03daf9 100644 --- a/trackerforce-common/src/main/java/com/trackerforce/common/config/OpenAPIConfiguration.java +++ b/trackerforce-common/src/main/java/com/trackerforce/common/config/OpenAPIConfiguration.java @@ -18,16 +18,16 @@ public class OpenAPIConfiguration { private static final String SCHEME = "Bearer"; - private final ConfigProperties configProperties; + private final ServiceConfig.Docs docs; - public OpenAPIConfiguration(ConfigProperties configProperties) { - this.configProperties = configProperties; + public OpenAPIConfiguration(ServiceConfig serviceConfig) { + this.docs = serviceConfig.docs(); } @Bean public OpenAPI customOpenAPI() { var openApi = new OpenAPI() - .addServersItem(new Server().url(configProperties.getUrl())) + .addServersItem(new Server().url(docs.url())) .info(getInfo()); addSecurity(openApi); @@ -36,23 +36,23 @@ public OpenAPI customOpenAPI() { private Info getInfo() { return new Info() - .title(configProperties.getTitle()) - .description(configProperties.getDescription()) - .version(configProperties.getVersion()) + .title(docs.title()) + .description(docs.description()) + .version(docs.version()) .contact(getContact()) .license(getLicense()); } private License getLicense() { return new License() - .name(configProperties.getLicense().getType()) - .url(configProperties.getLicense().getUrl()); + .name(docs.license().type()) + .url(docs.license().url()); } - + private Contact getContact() { return new Contact() - .name(configProperties.getContact().getAuthor()) - .email(configProperties.getContact().getEmail()); + .name(docs.contact().author()) + .email(docs.contact().email()); } private void addSecurity(OpenAPI openApi) { diff --git a/trackerforce-common/src/main/java/com/trackerforce/common/config/ServiceConfig.java b/trackerforce-common/src/main/java/com/trackerforce/common/config/ServiceConfig.java new file mode 100644 index 0000000..abd8078 --- /dev/null +++ b/trackerforce-common/src/main/java/com/trackerforce/common/config/ServiceConfig.java @@ -0,0 +1,27 @@ +package com.trackerforce.common.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +@ConfigurationProperties(prefix = "service") +public record ServiceConfig( + Docs docs +) { + + public record Docs( + String title, + String description, + String version, + String releaseTime, + String url, + License license, + Contact contact) { + + public record License( + String type, + String url) { } + + public record Contact( + String author, + String email) { } + } +} diff --git a/trackerforce-identity/src/main/java/com/trackerforce/identity/TrackerforceIdentityApplication.java b/trackerforce-identity/src/main/java/com/trackerforce/identity/TrackerforceIdentityApplication.java index 1bb0eb4..63e6c2c 100644 --- a/trackerforce-identity/src/main/java/com/trackerforce/identity/TrackerforceIdentityApplication.java +++ b/trackerforce-identity/src/main/java/com/trackerforce/identity/TrackerforceIdentityApplication.java @@ -2,9 +2,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication +@ConfigurationPropertiesScan(basePackages = { "com.trackerforce" }) @ComponentScan(basePackages = { "com.trackerforce" }) public class TrackerforceIdentityApplication { diff --git a/trackerforce-management/src/main/java/com/trackerforce/management/TrackerforceManagementApplication.java b/trackerforce-management/src/main/java/com/trackerforce/management/TrackerforceManagementApplication.java index 7ad1725..6964e7d 100644 --- a/trackerforce-management/src/main/java/com/trackerforce/management/TrackerforceManagementApplication.java +++ b/trackerforce-management/src/main/java/com/trackerforce/management/TrackerforceManagementApplication.java @@ -2,8 +2,12 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; +import org.springframework.context.annotation.ComponentScan; -@SpringBootApplication(scanBasePackages = "com.trackerforce") +@SpringBootApplication +@ConfigurationPropertiesScan(basePackages = { "com.trackerforce" }) +@ComponentScan(basePackages = { "com.trackerforce" }) public class TrackerforceManagementApplication { public static void main(String[] args) { diff --git a/trackerforce-session/pom.xml b/trackerforce-session/pom.xml index 81aa772..d0d7dda 100644 --- a/trackerforce-session/pom.xml +++ b/trackerforce-session/pom.xml @@ -19,7 +19,7 @@ 0.0.2-SNAPSHOT - 2.4.1 + 2.5.1 diff --git a/trackerforce-session/src/main/java/com/trackerforce/session/TrackerforceSessionApplication.java b/trackerforce-session/src/main/java/com/trackerforce/session/TrackerforceSessionApplication.java index 0c19adf..21b231e 100644 --- a/trackerforce-session/src/main/java/com/trackerforce/session/TrackerforceSessionApplication.java +++ b/trackerforce-session/src/main/java/com/trackerforce/session/TrackerforceSessionApplication.java @@ -3,10 +3,14 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; +import org.springframework.context.annotation.ComponentScan; import static com.trackerforce.session.config.Features.*; -@SpringBootApplication(scanBasePackages = "com.trackerforce") +@SpringBootApplication +@ConfigurationPropertiesScan(basePackages = { "com.trackerforce" }) +@ComponentScan(basePackages = { "com.trackerforce" }) public class TrackerforceSessionApplication implements CommandLineRunner { public static void main(String[] args) { diff --git a/trackerforce-session/src/main/resources/snapshots/default.json b/trackerforce-session/src/main/resources/snapshots/default.json index 590072b..0a09a20 100644 --- a/trackerforce-session/src/main/resources/snapshots/default.json +++ b/trackerforce-session/src/main/resources/snapshots/default.json @@ -1,29 +1,27 @@ { - "data": { - "domain": { - "name": "Trackerforce", - "version": 1632024551905, - "group": [ - { - "name": "Services", - "config": [ - { - "key": "ML_SERVICE", - "strategies": [], - "components": [ - "queue-service", - "session-service" - ], - "description": "Invoke Machine Learning Engine Service", - "activated": true - } - ], - "description": "", - "activated": true - } - ], - "description": "", - "activated": true - } + "domain": { + "name": "Trackerforce", + "version": 1632024551905, + "group": [ + { + "name": "Services", + "config": [ + { + "key": "ML_SERVICE", + "strategies": [], + "components": [ + "queue-service", + "session-service" + ], + "description": "Invoke Machine Learning Engine Service", + "activated": true + } + ], + "description": "", + "activated": true + } + ], + "description": "", + "activated": true } } \ No newline at end of file