Upgrade Guide: Transitioning DIGIT Modules to Spring Boot Version 3.2.2


This document contains information about the code changes that will be required in the registries for upgrading Spring boot and client libraries


POM Updates

  1. 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:

  1. Upgrade spring-boot-starter-parent library to version 3.2.2. The code snippet of the dependency is shown below:

  1. Upgrade the Flyway library to version 9.22.3 for compatibility with Postgres 14. Below is the code snippet:

  1. Upgrade the postgresql library to version 42.7.1:

  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:

  1. 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

  2. Use the below version of JUnit which is compatible with Java 17:

  1. If you are using the MDMS client library update the dependency version to 2.9.0-SNAPSHOT as shown below:

  1. Update the Lombok version in the pom.xml to 1.8.22:

  1. If you are using net.minidev library, upgrade the version to 2.5.0

  1. 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.

Registry Code Changes

  1. 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.

  2. Remove the annotation @javax.annotation.Generated which is now deprecated.

  3. 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"]

  1. 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

  1. If you are using spring-redis, add the following configuration file:

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConfiguration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;

public class RedisConfig {

    private String redisHost;

    private int redisPort;

    public RedisConnectionFactory redisConnectionFactory() {
        RedisConfiguration redisConfiguration = new RedisStandaloneConfiguration(redisHost, redisPort);
        return new LettuceConnectionFactory(redisConfiguration);

    public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
        return new StringRedisTemplate(redisConnectionFactory);

  1. Remove @SafeHtml annotation from the fields in POJO models as it is deprecated.

  2. Update the Junit dependencies in the test cases as shown below:

Last updated

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.