Spring App Advisor adds unexpected explicit or milestone dependency versions during Spring Boot 4 upgrade
search cancel

Spring App Advisor adds unexpected explicit or milestone dependency versions during Spring Boot 4 upgrade

book

Article ID: 437703

calendar_today

Updated On:

Products

VMware Tanzu Platform Spring

Issue/Introduction

When Spring App Advisor upgrades a Maven project to Spring Boot 4, some Spring Boot-managed dependencies may be added to pom.xml with an explicit version instead of being left under Spring Boot BOM management.

In affected cases, the explicit version may be unexpected for the intended upgrade path and can include milestone builds. As a result, the generated pom.xml may look inconsistent with normal Spring Boot dependency management, where Spring Boot starters are typically versionless and controlled by the Spring Boot BOM. 

In other words, you are seeing something like below:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-webmvc-test</artifactId>
  <version>4.1.0-M4</version>
</dependency>

while you expect to see something like this, when BOM management is working correctly:

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

Environment

 

  • Spring App Advisor 1.6.x
  • Maven projects using Spring Boot dependency management
  • Projects being upgraded from Spring Boot 3.x to Spring Boot 4.x

 

Cause

This issue can occur when Spring App Advisor cannot reliably resolve the project’s Maven dependency-management context during the migration.

When that happens, a dependency that would normally be managed by the Spring Boot BOM may instead be written to pom.xml with an explicit version. If the dependency is resolved outside the expected BOM-managed context, the selected version may not align with the intended Spring Boot 4.0.x upgrade path and may include milestone builds.

One known trigger is a custom dependency version property or BOM override in pom.xml that is compatible with the source Spring Boot version but not with the target Spring Boot version (e.g., <jackson-bom.version>2.21.2</jackson-bom.version> from Boot 3.x).

Resolution

Review the project pom.xml for custom version properties, BOM overrides, or other dependency-management customizations carried over from the previous Spring Boot version. E.g remove or correct properties like:

<properties>
<jackson-bom.version>...</jackson-bom.version>
</properties>

Remove or correct any entries that are not valid for the target Spring Boot 4.x line, then rerun Spring App Advisor.

If Spring App Advisor has already added a Spring Boot-managed dependency with an explicit version, remove the explicit version so that the dependency is managed by the Spring Boot BOM, provided that BOM resolution is working correctly.

If immediate cleanup of the project configuration is not possible, manually align the dependency to the intended supported Spring Boot 4.0.x line until the underlying dependency-management issue is corrected.

Additional Information

One reported example involved a project that retained a custom pom.xml property override from the previous Spring Boot line. After the project parent was updated to Spring Boot 4, that override interfered with dependency-management resolution and contributed to a Spring Boot-managed dependency being written with an explicit version instead of remaining BOM-managed.