Spring / Spring AI interview questions
What does the spring-ai-bom do and why should you use it?
The spring-ai-bom (Bill of Materials) is a Maven/Gradle POM that centralises version declarations for all Spring AI modules. By importing the BOM you avoid specifying versions on individual Spring AI starter dependencies, eliminating version mismatch bugs and ensuring all Spring AI modules you use are from the same tested-together release.
<!-- Maven --> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.ai</groupId> <artifactId>spring-ai-bom</artifactId> <version>1.0.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <!-- Then add starters WITHOUT version --> <dependency> <groupId>org.springframework.ai</groupId> <artifactId>spring-ai-openai-spring-boot-starter</artifactId> </dependency>
// Gradle implementation platform("org.springframework.ai:spring-ai-bom:1.0.0") implementation "org.springframework.ai:spring-ai-openai-spring-boot-starter"
Spring AI follows Spring Boot's snapshot and milestone release cadence and is published to the Spring Milestone and Snapshot repositories. If you add the BOM and still see resolution failures, check that your Maven settings or Gradle repositories include https://repo.spring.io/milestone alongside Maven Central.
More Related questions...