Skip to content

Commit cb21461

Browse files
authored
Bump Spring Boot baseline from 3.2 to 3.3 (#110)
## Change - Update Spring Boot baseline to 3.3.8 because 3.2.x reached EOL (2024-11-23). See: https://spring.io/projects/spring-boot#support - Use Spring Boot Dependencies BOM in parent pom.xml and simplified dependency management and versioning. - Configured main pipeline to run tests on Java 23 as well. - Fix Voyage autotests when API key is not configured. ## General checklist - [X] There are no breaking changes - [ ] I have added unit and/or integration tests for my change - [ ] The tests cover both positive and negative cases - [X] I have manually run all the unit and integration tests in the module I have added/changed, and they are all green - [ ] I have added/updated the [documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs) - [ ] I have added an example in the [examples repo](https://github.com/langchain4j/langchain4j-examples) (only for "big" features)
1 parent cc8605b commit cb21461

File tree

25 files changed

+35
-90
lines changed

25 files changed

+35
-90
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
java_build:
1313
strategy:
1414
matrix:
15-
java_version: [ 17, 21, 22 ]
15+
java_version: [ 17, 21, 22, 23 ]
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4

.sdkmanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# See https://sdkman.io/usage#config
44
# A summary is to add the following to ~/.sdkman/etc/config
55
# sdkman_auto_env=true
6-
java=17.0.11-tem
6+
java=17.0.14-tem

langchain4j-anthropic-spring-boot-starter/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<dependency>
2020
<groupId>dev.langchain4j</groupId>
2121
<artifactId>langchain4j-anthropic</artifactId>
22-
<version>${project.version}</version>
2322
</dependency>
2423

2524
<dependency>

langchain4j-anthropic-spring-boot-starter/src/test/java/dev/langchain4j/anthropic/spring/AutoConfigIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import dev.langchain4j.model.output.Response;
1010
import org.junit.jupiter.api.AfterEach;
1111
import org.junit.jupiter.api.Test;
12+
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
1213
import org.springframework.boot.autoconfigure.AutoConfigurations;
1314
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
1415

@@ -17,6 +18,7 @@
1718
import static java.util.concurrent.TimeUnit.SECONDS;
1819
import static org.assertj.core.api.Assertions.assertThat;
1920

21+
@EnabledIfEnvironmentVariable(named = "ANTHROPIC_API_KEY", matches = ".+")
2022
class AutoConfigIT {
2123

2224
private static final String API_KEY = System.getenv("ANTHROPIC_API_KEY");

langchain4j-azure-ai-search-spring-boot-starter/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<dependency>
2121
<groupId>dev.langchain4j</groupId>
2222
<artifactId>langchain4j-azure-ai-search</artifactId>
23-
<version>${project.version}</version>
2423
</dependency>
2524

2625
<dependency>
@@ -57,7 +56,6 @@
5756
<dependency>
5857
<groupId>dev.langchain4j</groupId>
5958
<artifactId>langchain4j-embeddings-all-minilm-l6-v2</artifactId>
60-
<version>${project.version}</version>
6159
<scope>test</scope>
6260
</dependency>
6361

langchain4j-azure-ai-search-spring-boot-starter/src/test/java/dev/langchain4j/azure/aisearch/spring/AutoConfigIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import static java.util.Arrays.asList;
3131
import static org.assertj.core.api.Assertions.assertThat;
3232

33+
@EnabledIfEnvironmentVariable(named = "AZURE_SEARCH_KEY", matches = ".+")
3334
class AutoConfigIT {
3435

3536
private static final Logger log = LoggerFactory.getLogger(AutoConfigIT.class);

langchain4j-azure-open-ai-spring-boot-starter/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<dependency>
2121
<groupId>dev.langchain4j</groupId>
2222
<artifactId>langchain4j-azure-open-ai</artifactId>
23-
<version>${project.version}</version>
2423
</dependency>
2524

2625
<dependency>

langchain4j-azure-open-ai-spring-boot-starter/src/test/java/dev/langchain4j/azure/openai/spring/AutoConfigIT.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import dev.langchain4j.model.image.ImageModel;
2020
import dev.langchain4j.model.output.Response;
2121
import org.junit.jupiter.api.Test;
22+
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
2223
import org.junit.jupiter.params.ParameterizedTest;
2324
import org.junit.jupiter.params.provider.CsvSource;
2425
import org.mockito.InOrder;
@@ -53,6 +54,7 @@ class AutoConfigIT {
5354
"gpt-4o-mini",
5455
"gpt-4o"
5556
})
57+
@EnabledIfEnvironmentVariable(named = "AZURE_OPENAI_KEY", matches = ".+")
5658
void should_provide_chat_model(String deploymentName) {
5759
contextRunner
5860
.withPropertyValues(
@@ -71,6 +73,7 @@ void should_provide_chat_model(String deploymentName) {
7173
}
7274

7375
@Test
76+
@EnabledIfEnvironmentVariable(named = "AZURE_OPENAI_KEY", matches = ".+")
7477
void should_provide_chat_model_with_listeners() {
7578
contextRunner
7679
.withPropertyValues(
@@ -102,6 +105,7 @@ void should_provide_chat_model_with_listeners() {
102105
@CsvSource({
103106
"gpt-4o-mini"
104107
})
108+
@EnabledIfEnvironmentVariable(named = "AZURE_OPENAI_KEY", matches = ".+")
105109
void should_provide_chat_model_with_json_schema(String deploymentName) {
106110
contextRunner
107111
.withPropertyValues(
@@ -142,6 +146,7 @@ void should_provide_chat_model_with_json_schema(String deploymentName) {
142146
@CsvSource({
143147
"gpt-3.5-turbo"
144148
})
149+
@EnabledIfEnvironmentVariable(named = "OPENAI_API_KEY", matches = ".+")
145150
void should_provide_chat_model_no_azure(String deploymentName) {
146151
contextRunner
147152
.withPropertyValues(
@@ -165,6 +170,7 @@ void should_provide_chat_model_no_azure(String deploymentName) {
165170
"gpt-4o-mini",
166171
"gpt-4o"
167172
})
173+
@EnabledIfEnvironmentVariable(named = "AZURE_OPENAI_KEY", matches = ".+")
168174
void should_provide_streaming_chat_model(String deploymentName) {
169175
contextRunner
170176
.withPropertyValues(
@@ -202,6 +208,7 @@ public void onError(Throwable error) {
202208
}
203209

204210
@Test
211+
@EnabledIfEnvironmentVariable(named = "AZURE_OPENAI_KEY", matches = ".+")
205212
void should_provide_streaming_chat_model_with_listeners() {
206213
contextRunner
207214
.withPropertyValues(
@@ -249,6 +256,7 @@ public void onError(Throwable error) {
249256
}
250257

251258
@Test
259+
@EnabledIfEnvironmentVariable(named = "AZURE_OPENAI_KEY", matches = ".+")
252260
void should_provide_embedding_model() {
253261
contextRunner
254262
.withPropertyValues("langchain4j.azure-open-ai.embedding-model.api-key=" + AZURE_OPENAI_KEY,
@@ -265,6 +273,7 @@ void should_provide_embedding_model() {
265273
}
266274

267275
@Test
276+
@EnabledIfEnvironmentVariable(named = "AZURE_OPENAI_KEY", matches = ".+")
268277
void should_provide_image_model() {
269278
contextRunner
270279
.withPropertyValues(

langchain4j-easy-rag-spring-boot-starter/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<dependency>
2020
<groupId>dev.langchain4j</groupId>
2121
<artifactId>langchain4j-easy-rag</artifactId>
22-
<version>${project.version}</version>
2322
</dependency>
2423

2524
<dependency>

langchain4j-elasticsearch-spring-boot-starter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<dependency>
102102
<groupId>commons-io</groupId>
103103
<artifactId>commons-io</artifactId>
104-
<version>2.17.0</version>
104+
<version>2.18.0</version>
105105
<scope>test</scope>
106106
</dependency>
107107

langchain4j-github-models-spring-boot-starter/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<dependency>
2121
<groupId>dev.langchain4j</groupId>
2222
<artifactId>langchain4j-github-models</artifactId>
23-
<version>${project.version}</version>
2423
</dependency>
2524

2625
<dependency>

langchain4j-github-models-spring-boot-starter/src/test/java/dev/langchain4j/model/githubmodels/spring/AutoConfigIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import dev.langchain4j.model.github.GitHubModelsStreamingChatModel;
1111
import dev.langchain4j.model.output.Response;
1212
import org.junit.jupiter.api.Test;
13+
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
1314
import org.springframework.boot.autoconfigure.AutoConfigurations;
1415
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
1516

@@ -18,6 +19,7 @@
1819
import static java.util.concurrent.TimeUnit.SECONDS;
1920
import static org.assertj.core.api.Assertions.assertThat;
2021

22+
@EnabledIfEnvironmentVariable(named = "GITHUB_TOKEN", matches = ".+")
2123
class AutoConfigIT {
2224

2325
private static final String GITHUB_TOKEN = System.getenv("GITHUB_TOKEN");

langchain4j-google-ai-gemini-spring-boot-starter/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<dependency>
2121
<groupId>dev.langchain4j</groupId>
2222
<artifactId>langchain4j-google-ai-gemini</artifactId>
23-
<version>${project.version}</version>
2423
</dependency>
2524

2625
<dependency>
@@ -47,8 +46,6 @@
4746
<scope>test</scope>
4847
</dependency>
4948

50-
51-
5249
</dependencies>
5350

5451
<licenses>

langchain4j-google-ai-gemini-spring-boot-starter/src/test/java/dev/langchain4j/googleaigemini/spring/AutoConfigIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import dev.langchain4j.model.googleai.GoogleAiGeminiStreamingChatModel;
1212
import dev.langchain4j.model.output.Response;
1313
import org.junit.jupiter.api.Test;
14+
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
1415
import org.springframework.boot.autoconfigure.AutoConfigurations;
1516
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
1617

@@ -19,6 +20,7 @@
1920
import static java.util.concurrent.TimeUnit.SECONDS;
2021
import static org.assertj.core.api.Assertions.assertThat;
2122

23+
@EnabledIfEnvironmentVariable(named = "GOOGLE_AI_GEMINI_API_KEY", matches = ".+")
2224
class AutoConfigIT {
2325

2426
private static final String API_KEY = System.getenv("GOOGLE_AI_GEMINI_API_KEY");

langchain4j-http-client-spring-restclient/pom.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<dependency>
2020
<groupId>dev.langchain4j</groupId>
2121
<artifactId>langchain4j-http-client</artifactId>
22-
<version>${project.version}</version>
2322
</dependency>
2423

2524
<dependency>
@@ -46,20 +45,19 @@
4645
<dependency>
4746
<groupId>org.apache.httpcomponents.client5</groupId>
4847
<artifactId>httpclient5</artifactId>
49-
<version>5.4.1</version>
5048
<scope>test</scope>
5149
</dependency>
5250

5351
<dependency>
5452
<groupId>io.projectreactor.netty</groupId>
5553
<artifactId>reactor-netty</artifactId>
56-
<version>1.2.2</version>
5754
<scope>test</scope>
5855
</dependency>
5956

57+
<!-- Why "wiremock-jetty12" and not "wiremock": https://github.com/wiremock/wiremock/issues/2922 -->
6058
<dependency>
6159
<groupId>org.wiremock</groupId>
62-
<artifactId>wiremock</artifactId>
60+
<artifactId>wiremock-jetty12</artifactId>
6361
<version>3.10.0</version>
6462
<scope>test</scope>
6563
</dependency>

langchain4j-ollama-spring-boot-starter/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<dependency>
2424
<groupId>dev.langchain4j</groupId>
2525
<artifactId>langchain4j-ollama</artifactId>
26-
<version>${project.version}</version>
2726
<exclusions>
2827
<exclusion>
2928
<groupId>dev.langchain4j</groupId>

langchain4j-ollama-spring-boot-starter/src/test/java/dev/langchain4j/ollama/spring/AutoConfigIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void should_create_chat_model_with_default_http_client() {
137137
contextRunner.run(context -> {
138138

139139
OllamaChatModel model = OllamaChatModel.builder()
140-
.baseUrl(OLLAMA_BASE_URL)
140+
.baseUrl(baseUrl())
141141
.modelName(MODEL_NAME)
142142
.temperature(0.0)
143143
.numPredict(20)
@@ -273,7 +273,7 @@ void should_create_streaming_chat_model_with_default_http_client() {
273273
contextRunner.run(context -> {
274274

275275
OllamaStreamingChatModel model = OllamaStreamingChatModel.builder()
276-
.baseUrl(OLLAMA_BASE_URL)
276+
.baseUrl(baseUrl())
277277
.modelName(MODEL_NAME)
278278
.temperature(0.0)
279279
.numPredict(20)
@@ -377,7 +377,7 @@ void should_create_embedding_model_with_default_http_client() {
377377
contextRunner.run(context -> {
378378

379379
OllamaEmbeddingModel model = OllamaEmbeddingModel.builder()
380-
.baseUrl(OLLAMA_BASE_URL)
380+
.baseUrl(baseUrl())
381381
.modelName(MODEL_NAME)
382382
.build();
383383

langchain4j-open-ai-spring-boot-starter/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<dependency>
2020
<groupId>dev.langchain4j</groupId>
2121
<artifactId>langchain4j-open-ai</artifactId>
22-
<version>${project.version}</version>
2322
</dependency>
2423

2524
<dependency>

langchain4j-open-ai-spring-boot-starter/src/test/java/dev/langchain4j/openai/spring/AutoConfigIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import dev.langchain4j.model.openai.*;
1414
import dev.langchain4j.model.output.Response;
1515
import org.junit.jupiter.api.Test;
16+
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
1617
import org.mockito.InOrder;
1718
import org.mockito.Mockito;
1819
import org.springframework.boot.autoconfigure.AutoConfigurations;
@@ -28,6 +29,7 @@
2829
import static org.mockito.ArgumentMatchers.any;
2930
import static org.mockito.Mockito.mock;
3031

32+
@EnabledIfEnvironmentVariable(named = "OPENAI_API_KEY", matches = ".+")
3133
class AutoConfigIT {
3234

3335
private static final String API_KEY = System.getenv("OPENAI_API_KEY");

langchain4j-reactor/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,36 @@
1919
<dependency>
2020
<groupId>dev.langchain4j</groupId>
2121
<artifactId>langchain4j</artifactId>
22-
<version>${project.version}</version>
2322
</dependency>
2423

2524
<dependency>
2625
<groupId>io.projectreactor</groupId>
2726
<artifactId>reactor-core</artifactId>
28-
<version>3.6.11</version>
2927
</dependency>
3028

3129
<!-- TEST -->
3230

3331
<dependency>
3432
<groupId>io.projectreactor</groupId>
3533
<artifactId>reactor-test</artifactId>
36-
<version>3.7.0</version>
3734
<scope>test</scope>
3835
</dependency>
3936

4037
<dependency>
4138
<groupId>org.junit.jupiter</groupId>
4239
<artifactId>junit-jupiter-engine</artifactId>
43-
<version>5.11.3</version>
4440
<scope>test</scope>
4541
</dependency>
4642

4743
<dependency>
4844
<groupId>org.assertj</groupId>
4945
<artifactId>assertj-core</artifactId>
50-
<version>3.26.3</version>
5146
<scope>test</scope>
5247
</dependency>
5348

5449
<dependency>
5550
<groupId>dev.langchain4j</groupId>
5651
<artifactId>langchain4j-open-ai</artifactId>
57-
<version>${project.version}</version>
5852
<scope>test</scope>
5953
</dependency>
6054

langchain4j-spring-boot-starter/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<dependency>
2020
<groupId>dev.langchain4j</groupId>
2121
<artifactId>langchain4j</artifactId>
22-
<version>${project.version}</version>
2322
</dependency>
2423

2524
<dependency>
@@ -56,7 +55,6 @@
5655
<dependency>
5756
<groupId>org.springframework.boot</groupId>
5857
<artifactId>spring-boot-starter-aop</artifactId>
59-
<version>${spring.boot.version}</version>
6058
<scope>test</scope>
6159
</dependency>
6260

langchain4j-vertex-ai-gemini-spring-boot-starter/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<dependency>
2020
<groupId>dev.langchain4j</groupId>
2121
<artifactId>langchain4j-vertex-ai-gemini</artifactId>
22-
<version>${project.version}</version>
2322
</dependency>
2423

2524
<dependency>

langchain4j-voyage-ai-spring-boot-starter/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<dependency>
2424
<groupId>dev.langchain4j</groupId>
2525
<artifactId>langchain4j-voyage-ai</artifactId>
26-
<version>${project.version}</version>
2726
</dependency>
2827

2928
<dependency>

langchain4j-voyage-ai-spring-boot-starter/src/test/java/dev/langchain4j/voyageai/spring/AutoConfigIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import dev.langchain4j.model.voyageai.VoyageAiScoringModel;
1010
import dev.langchain4j.model.voyageai.VoyageAiScoringModelName;
1111
import org.junit.jupiter.api.Test;
12+
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
1213
import org.springframework.boot.autoconfigure.AutoConfigurations;
1314
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
1415

@@ -17,6 +18,7 @@
1718
import static java.util.Arrays.asList;
1819
import static org.assertj.core.api.Assertions.assertThat;
1920

21+
@EnabledIfEnvironmentVariable(named = "VOYAGE_API_KEY", matches = ".+")
2022
class AutoConfigIT {
2123

2224
ApplicationContextRunner contextRunner = new ApplicationContextRunner()

0 commit comments

Comments
 (0)