Commit d5e92be
Upgrade to Spring Boot 4.0.0-RC2 (#4774)
Upgrade Spring AI to Spring Boot 4.0.0-RC2 following the
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide
Major version upgrades:
- Spring Boot: 3.5.7 → 4.0.0-RC2
- Kotlin: 1.9.25 → 2.2.21 (with Kotlin compiler 2.2.21)
- Rest Assured: added BOM 5.5.6
- swagger-codegen-maven-plugin: 3.0.64 → 3.0.75
- Testcontainers: 1.20.4 → 2.0.1
- Updated Elasticsearch test container to 9.2.0
- Keep opensearch-testcontainers to 2.0.1 for Java 17 compatibility
- Gemfire Testcontainers: 2.3.0 → 2.3.3
Spring Boot package reorganization:
- MongoDB: o.s.b.autoconfigure.mongo → o.s.b.mongodb.autoconfigure
- Data Redis: o.s.b.autoconfigure.data.redis → o.s.b.data.redis.autoconfigure
- JDBC: o.s.b.autoconfigure.jdbc → o.s.b.jdbc.autoconfigure
- Cassandra: o.s.b.autoconfigure.cassandra → o.s.b.cassandra.autoconfigure
- Neo4j: o.s.b.autoconfigure.neo4j → o.s.b.neo4j.autoconfigure
- Couchbase: o.s.b.autoconfigure.couchbase → o.s.b.couchbase.autoconfigure
- RestClient: o.s.b.autoconfigure.web.client → o.s.b.restclient.autoconfigure
- WebClient: o.s.b.autoconfigure.web.reactive → o.s.b.webclient.autoconfigure
- Servlet: o.s.b.autoconfigure.web.servlet → o.s.b.web.server.autoconfigure.servlet
Spring Framework 6.x/7.x compatibility:
- Add constructors without logic to *Api classes for better extensibility
Adopt new modular design of starters:
- Added explicit spring-boot-starter-* dependencies (jdbc, cassandra, mongodb, neo4j, elasticsearch, etc.)
- Added spring-boot-starter-restclient and spring-boot-starter-webclient where needed
Use new Jackson 3.x API:
- Updated import com.fasterxml.jackson.databind.json.JsonMapper
- Modified ObjectMapper configurations for compatibility
Migrated from Spring Retry to Spring Framework Retry:
- org.springframework.retry → org.springframework.core.retry
- Updated RetryTemplate, RetryPolicy, and RetryListener APIs
- Replaced RetryCallback/RetryContext with new Retryable interface
Property Mapper API changes:
- Updated PropertyMapper null handling (changed from .whenNonNull() to direct usage)
- Applied in Couchbase and Elasticsearch vector store configurations
API changes:
- Replaced MultiValueMap<String, String> with HttpHeaders for HTTP headers
- Updated Elasticsearch client to use Rest5Client (from RestClient)
- Standardized header handling across OpenAI, Anthropic, DeepSeek, MiniMax, ZhiPuAI, Mistral AI, and other APIs
- Added overloaded constructors accepting RestClient/WebClient directly
- Updated HttpHeaders methods (.containsKey() → .get())
Testcontainers artifact naming:
- Standardized to prefixed format (e.g., junit-jupiter → testcontainers-junit-jupiter)
- Updated across all modules: Cassandra, PostgreSQL, MongoDB, Neo4j, Milvus, Qdrant, etc.
Additional improvements:
- Updated Swagger codegen templates for Huggingface model to align with latest Spring Framework APIs
- Added FailureDetectingExternalResource from old testcontainers versions for gemfire-testcontainers compatibility
- Updated Kotlin nullable type handling in extensions (reified T → reified T : Any)
- Added missing test dependencies (spring-boot-restclient-test, spring-boot-starter-jdbc-test)
Resolves: #3379
Extends and replaces: #4771, #4681
Co-authored-by: Paul Bakker <[email protected]>
Signed-off-by: Dmitry Bedrin <[email protected]>
Signed-off-by: Christian Tzolov <[email protected]>1 parent 10bc0a7 commit d5e92be
File tree
263 files changed
+2636
-1064
lines changed- auto-configurations
- common/spring-ai-autoconfigure-retry
- src
- main/java/org/springframework/ai/retry/autoconfigure
- test/java/org/springframework/ai/retry/autoconfigure
- mcp
- spring-ai-autoconfigure-mcp-client-httpclient
- spring-ai-autoconfigure-mcp-client-webflux
- spring-ai-autoconfigure-mcp-server-webflux
- src/test/java/org/springframework/ai/mcp/server/autoconfigure
- models
- chat/memory
- repository
- spring-ai-autoconfigure-model-chat-memory-repository-cassandra
- src
- main/java/org/springframework/ai/model/chat/memory/repository/cassandra/autoconfigure
- test/java/org/springframework/ai/model/chat/memory/repository/cassandra/autoconfigure
- spring-ai-autoconfigure-model-chat-memory-repository-cosmos-db
- spring-ai-autoconfigure-model-chat-memory-repository-jdbc
- src
- main/java/org/springframework/ai/model/chat/memory/repository/jdbc/autoconfigure
- test/java/org/springframework/ai/model/chat/memory/repository/jdbc/autoconfigure
- spring-ai-autoconfigure-model-chat-memory-repository-mongodb
- src/test/java/org/springframework/ai/model/chat/memory/repository/mongo/autoconfigure
- spring-ai-autoconfigure-model-chat-memory-repository-neo4j
- src
- main/java/org/springframework/ai/model/chat/memory/repository/neo4j/autoconfigure
- test/java/org/springframework/ai/model/chat/memory/repository/neo4j/autoconfigure
- spring-ai-autoconfigure-model-chat-memory
- spring-ai-autoconfigure-model-anthropic
- src
- main/java/org/springframework/ai/model/anthropic/autoconfigure
- test/java/org/springframework/ai/model/anthropic/autoconfigure
- spring-ai-autoconfigure-model-deepseek
- src
- main/java/org/springframework/ai/model/deepseek/autoconfigure
- test/java/org/springframework/ai/model/deepseek/autoconfigure
- spring-ai-autoconfigure-model-elevenlabs
- src
- main/java/org/springframework/ai/model/elevenlabs/autoconfigure
- test/java/org/springframework/ai/model/elevenlabs/autoconfigure
- spring-ai-autoconfigure-model-google-genai
- src
- main/java/org/springframework/ai/model/google/genai/autoconfigure
- chat
- embedding
- test/java/org/springframework/ai/model/google/genai/autoconfigure/chat/tool
- spring-ai-autoconfigure-model-minimax
- src/main/java/org/springframework/ai/model/minimax/autoconfigure
- spring-ai-autoconfigure-model-mistral-ai
- src/main/java/org/springframework/ai/model/mistralai/autoconfigure
- spring-ai-autoconfigure-model-ollama
- src/main/java/org/springframework/ai/model/ollama/autoconfigure
- spring-ai-autoconfigure-model-openai
- src/main/java/org/springframework/ai/model/openai/autoconfigure
- spring-ai-autoconfigure-model-postgresml-embedding
- src
- main/java/org/springframework/ai/model/postgresml/autoconfigure
- test/java/org/springframework/ai/model/postgresml/autoconfigure
- spring-ai-autoconfigure-model-stability-ai
- src/main/java/org/springframework/ai/model/stabilityai/autoconfigure
- spring-ai-autoconfigure-model-vertex-ai
- src/main/java/org/springframework/ai/model/vertexai/autoconfigure
- embedding
- gemini
- spring-ai-autoconfigure-model-zhipuai
- src
- main/java/org/springframework/ai/model/zhipuai/autoconfigure
- test/java/org/springframework/ai/model/zhipuai/autoconfigure
- vector-stores
- spring-ai-autoconfigure-vector-store-cassandra
- src
- main/java/org/springframework/ai/vectorstore/cassandra/autoconfigure
- test/java/org/springframework/ai/vectorstore/cassandra/autoconfigure
- spring-ai-autoconfigure-vector-store-chroma
- spring-ai-autoconfigure-vector-store-couchbase
- src
- main/java/org/springframework/ai/vectorstore/couchbase/autoconfigure
- test/java/org/springframework/ai/vectorstore/couchbase/autoconfigure
- spring-ai-autoconfigure-vector-store-elasticsearch
- src
- main/java/org/springframework/ai/vectorstore/elasticsearch/autoconfigure
- test/java/org/springframework/ai/vectorstore/elasticsearch/autoconfigure
- spring-ai-autoconfigure-vector-store-gemfire
- src/test/java/org/testcontainers/containers
- spring-ai-autoconfigure-vector-store-mariadb
- src
- main/java/org/springframework/ai/vectorstore/mariadb/autoconfigure
- test/java/org/springframework/ai/vectorstore/mariadb/autoconfigure
- spring-ai-autoconfigure-vector-store-milvus
- spring-ai-autoconfigure-vector-store-mongodb-atlas
- src/test/java/org/springframework/ai/vectorstore/mongodb/autoconfigure
- spring-ai-autoconfigure-vector-store-neo4j
- src
- main/java/org/springframework/ai/vectorstore/neo4j/autoconfigure
- test/java/org/springframework/ai/vectorstore/neo4j/autoconfigure
- spring-ai-autoconfigure-vector-store-opensearch
- spring-ai-autoconfigure-vector-store-oracle
- src
- main/java/org/springframework/ai/vectorstore/oracle/autoconfigure
- test/java/org/springframework/ai/vectorstore/oracle/autoconfigure
- spring-ai-autoconfigure-vector-store-pgvector
- src
- main/java/org/springframework/ai/vectorstore/pgvector/autoconfigure
- test/java/org/springframework/ai/vectorstore/pgvector/autoconfigure
- spring-ai-autoconfigure-vector-store-pinecone
- spring-ai-autoconfigure-vector-store-qdrant
- spring-ai-autoconfigure-vector-store-redis
- src
- main/java/org/springframework/ai/vectorstore/redis/autoconfigure
- test/java/org/springframework/ai/vectorstore/redis/autoconfigure
- spring-ai-autoconfigure-vector-store-typesense
- spring-ai-autoconfigure-vector-store-weaviate
- document-readers/pdf-reader
- memory/repository
- spring-ai-model-chat-memory-repository-cassandra
- src/test/java/org/springframework/ai/chat/memory/repository/cassandra
- spring-ai-model-chat-memory-repository-jdbc
- src/test/java/org/springframework/ai/chat/memory/repository/jdbc
- spring-ai-model-chat-memory-repository-mongodb
- src/test/java/org/springframework/ai/chat/memory/repository/mongo
- spring-ai-model-chat-memory-repository-neo4j
- models
- spring-ai-anthropic/src
- main/java/org/springframework/ai/anthropic
- api
- test/java/org/springframework/ai/anthropic
- api
- spring-ai-deepseek/src
- main/java/org/springframework/ai/deepseek
- api
- test/java/org/springframework/ai/deepseek
- chat
- spring-ai-elevenlabs/src/main/java/org/springframework/ai/elevenlabs
- api
- spring-ai-google-genai-embedding/src
- main/java/org/springframework/ai/google/genai/text
- test/java/org/springframework/ai/google/genai/text
- spring-ai-google-genai/src
- main/java/org/springframework/ai/google/genai
- test/java/org/springframework/ai/google/genai
- spring-ai-huggingface
- src/main/resources/handlebars/Java/libraries/resttemplate
- spring-ai-minimax/src
- main/java/org/springframework/ai/minimax
- test/java/org/springframework/ai/minimax
- api
- embedding
- spring-ai-mistral-ai/src
- main/java/org/springframework/ai/mistralai
- moderation
- test/java/org/springframework/ai/mistralai
- spring-ai-ollama
- src
- main/java/org/springframework/ai/ollama
- test/java/org/springframework/ai/ollama
- spring-ai-openai
- src
- main/java/org/springframework/ai/openai
- api
- metadata/support
- test/java/org/springframework/ai/openai
- api
- audio
- api
- speech
- transcription
- chat
- embedding
- image
- api
- moderation
- api
- spring-ai-postgresml
- src/test/java/org/springframework/ai/postgresml
- spring-ai-transformers
- spring-ai-vertex-ai-embedding/src
- main/java/org/springframework/ai/vertexai/embedding/text
- test/java/org/springframework/ai/vertexai/embedding/text
- spring-ai-vertex-ai-gemini/src
- main/java/org/springframework/ai/vertexai/gemini
- test/java/org/springframework/ai/vertexai/gemini
- spring-ai-zhipuai/src
- main/java/org/springframework/ai/zhipuai
- api
- test/java/org/springframework/ai/zhipuai
- api
- chat
- embedding
- spring-ai-client-chat/src/main/kotlin/org/springframework/ai/chat/client
- spring-ai-integration-tests
- src/test/java/org/springframework/ai/integration/tests/tool
- spring-ai-model/src
- main/java/org/springframework/ai/chat/model
- test/kotlin/org/springframework/ai/tool/resolution
- spring-ai-retry
- src
- main/java/org/springframework/ai/retry
- test/java/org/springframework/ai/retry
- spring-ai-spring-boot-docker-compose
- src
- main/java/org/springframework/ai/docker/compose/service/connection/mongo
- test/java/org/springframework
- ai/docker/compose/service/connection/mongo
- boot/docker/compose/service/connection/test
- spring-ai-spring-boot-testcontainers
- src
- main/java/org/springframework/ai/testcontainers/service/connection/mongo
- test/java/org/springframework/ai/testcontainers/service/connection
- mongo
- ollama
- vector-stores
- spring-ai-azure-cosmos-db-store
- spring-ai-cassandra-store
- src/test/java/org/springframework/ai/vectorstore/cassandra
- spring-ai-chroma-store
- spring-ai-couchbase-store
- src/test/java/org/springframework/ai/vectorstore
- spring-ai-elasticsearch-store
- src
- main/java/org/springframework/ai/vectorstore/elasticsearch
- test/java/org/springframework/ai/vectorstore/elasticsearch
- spring-ai-gemfire-store
- src/test/java/org/testcontainers/containers
- spring-ai-mariadb-store
- src/test/java/org/springframework/ai/vectorstore/mariadb
- spring-ai-milvus-store
- src/test/java/org/springframework/ai/vectorstore/milvus
- spring-ai-mongodb-atlas-store
- spring-ai-neo4j-store
- src/test/java/org/springframework/ai/vectorstore/neo4j
- spring-ai-opensearch-store
- src/test/java/org/springframework/ai/vectorstore/opensearch
- spring-ai-oracle-store
- src/test/java/org/springframework/ai/vectorstore/oracle
- spring-ai-pgvector-store
- src/test/java/org/springframework/ai/vectorstore/pgvector
- spring-ai-qdrant-store
- spring-ai-redis-store
- src/test/java/org/springframework/ai/vectorstore/redis
- spring-ai-typesense-store
- src/test/java/org/springframework/ai/vectorstore/typesense
- spring-ai-weaviate-store
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
263 files changed
+2636
-1064
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
Lines changed: 31 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 42 | | |
41 | 43 | | |
42 | | - | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
| 65 | + | |
65 | 66 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
93 | 84 | | |
94 | 85 | | |
95 | 86 | | |
| |||
104 | 95 | | |
105 | 96 | | |
106 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
107 | 104 | | |
108 | 105 | | |
109 | 106 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
53 | 52 | | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
53 | 52 | | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
0 commit comments