When using Spring App Advisor to upgrade a Spring application (specifically targeting Spring Boot 4.x), the tool successfully migrates most MongoDB-related configurations and dependencies. For example, it correctly updates application properties (changing spring.data.mongodb.database to spring.mongodb.database) and updates Maven POM coordinates (migrating org.testcontainers.mongodb to org.testcontainers.testcontainers-mongodb).
However, the Advisor fails to update the Java import statement for MongoProperties. After the tool completes the upgrade, developers will experience compilation errors indicating that the legacy MongoProperties class cannot be found.
Tool: Tanzu Spring App Advisor
Framework: Spring Boot (Upgrading to 4.x)
Components: Spring Data MongoDB, MongoDB Testcontainers
During the Spring Boot 4.x release cycle, several MongoDB auto-configuration classes and properties were restructured into new, modular packages. While Spring App Advisor successfully executes the refactoring recipes to migrate properties (application.yml/application.properties) and build dependencies, the specific automation rule to migrate the MongoProperties package namespace is either missing or failing to trigger. Consequently, the tool leaves the legacy Spring Boot 3.x import path intact within the source code.
Until the issue is fixed in a future release, to resolve the resulting compilation errors, you must manually update the import statements in the affected Java classes.
Identify the Java classes failing to compile due to the unresolved MongoProperties import.
Remove the legacy import statement:
import org.springframework.boot.autoconfigure.mongo.MongoProperties;
Replace it with the updated Spring Boot 4.x import:
import org.springframework.boot.mongodb.autoconfigure.MongoProperties;
Rebuild and compile your application to verify the fix.