Start Today

← Documentation

Migrate to Core 5.2.0 (Spring Boot 4)

Applies to: projects upgrading from OpenLegacy Core 5.1.x to 5.2.0. If your project is on an earlier version, upgrade to 5.1.x first and then follow this guide.

Overview

Starting from version 5.2.0, OpenLegacy Core uses Spring Boot 4 for its APIs.

Because the Spring Boot 4 upgrade is inherited through OpenLegacy Core, projects that consume it must make a few small adjustments to keep building and running. This page describes the changes required.

Before you start

  • Confirm your project is currently on OpenLegacy Core 5.1.x.
  • Back up your project or ensure your work is committed to source control in case you need to roll back.
  • Plan to run a clean build after the changes (for example, mvn clean install) so that the new dependency tree is resolved from scratch.

Migration steps

Step 1 — Update the OpenLegacy Core version

In your project's pom.xml, change the openlegacy-core version from your current 5.1.x value to 5.2.0:

<version>5.2.0</version>

Step 2 — Update the pom.xml

Delete the following dependencies from your pom.xml if they exist:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
</dependency>

Add the following if missing:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
</dependency>

Step 3 — Update the @SpringBootApplication annotation

In the TestApplication class, change the annotation to remove SecurityAutoConfiguration.class and its import:

// @SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
@SpringBootApplication

Verifying the migration

After applying the changes:

  1. Run a clean build of the project.
  2. Confirm the build resolves OpenLegacy Core 5.2.0 without conflicts.
  3. Start the application and confirm it comes up without security auto-configuration being applied (no unexpected login prompt or generated default password on your API endpoints).
  4. Run your test suite to confirm spring-boot-starter-test is picked up correctly.

Troubleshooting

SymptomLikely causeWhat to check
Test classes fail to compile or test annotations cannot be resolvedTest starter missingConfirm spring-boot-starter-test was added with <scope>test</scope>
Old dependency versions still being resolvedStale local build artifactsRe-run the build with mvn clean install

See also Service project.


Source: How to Migrate to Spring Boot 4 Using OpenLegacy Core 5.2.0 (Confluence)

Upgrade generated projects from OpenLegacy Core 5.1.x to 5.2.0 (Spring Boot 4).

Read more