When moving to Spring AI 2.0.0-M3, you may encounter breaking changes. Spring AI provides an OpenRewrite migration recipe named org.springframework.ai.migration.MigrateToSpringAI200M3 in migrate-to-2-0-0-M3.yaml to automate most of the required code and dependency updates.
Spring AI projects upgrading to 2.0.0-M3
Maven-based builds using OpenRewrite Maven Plugin
From the root folder of your project, run the following command:
mvn org.openrewrite.maven:rewrite-maven-plugin:6.32.0:run \
-Drewrite.configLocation=https://raw.githubusercontent.com/spring-projects/spring-ai/refs/heads/main/src/rewrite/migrate-to-2-0-0-M3.yaml \
-Drewrite.activeRecipes=org.springframework.ai.migration.MigrateToSpringAI200M3
This command applies the Spring AI 2.0.0-M3 migration recipe and updates the project to address most breaking changes introduced in that release.