This document contains information about the code changes that will be required in the registries for upgrading Spring boot and client libraries
Upgrade the Java version in the module to Java 17 before upgrading the Spring Boot version to 3.2.2. Following is a sample snippet of the Java version upgrade:
Upgrade spring-boot-starter-parent library to version 3.2.2. The code snippet of the dependency is shown below:
Upgrade the Flyway library to version 9.22.3 for compatibility with Postgres 14. Below is the code snippet:
Upgrade the postgresql library to version 42.7.1:
The tracer library is upgraded to springboot 3.2.2. The updates are available in the library version 2.9.0-SNAPSHOT. If the module is using the tracer, upgrade the tracer version to 2.9.0-SNAPSHOT as shown below:
The service-common library is upgraded and added in tracer. You don't have to explicitly upgrade the services-common library and remove it from POM if you upgrade the tracer. In case your module is using only services-common, you can directly upgrade the version to 2.9.0-SNAPSHOT
Use the below version of JUnit which is compatible with Java 17:
If you are using the MDMS client library update the dependency version to 2.9.0-SNAPSHOT as shown below:
Update the Lombok version in the pom.xml to 1.8.22:
If you are using net.minidev library, upgrade the version to 2.5.0
To simplify dependency management and ensure version compatibility for Spring Kafka and Spring Redis dependencies use the spring-boot-starter-parent as your project's parent in the pom.xml. This ensures the spring-kafka or spring-redis dependency is included without specifying a version, Spring Boot will automatically provide a compatible version of the dependency. Following are code snippets of both the dependencies:
Note: If a tracer library is implemented there is no need to explicitly import spring-kafka.
Javax is deprecated and transitioning to Jakarta. Remove any Javax dependencies and update all Javax imports to Jakarta. For example, change imports like PostConstruct and valid to their Jakarta counterparts in all occurrences.
Remove the annotation @javax.annotation.Generated which is now deprecated.
Update the Dockerfile for flyway migration with the below content:
FROM egovio/flyway:10.7.1
COPY ./migration/main /flyway/sql
COPY migrate.sh /usr/bin/migrate.sh
RUN chmod +x /usr/bin/migrate.sh
ENTRYPOINT ["/usr/bin/migrate.sh"]
Update the migrate.sh script:
#!/bin/sh
flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true migrate
If you are using spring-redis, add the following configuration file:
Remove @SafeHtml annotation from the fields in POJO models as it is deprecated.
Update the Junit dependencies in the test cases as shown below: