Skip to content

Commit 23c838e

Browse files
ericbottardddobrin
authored andcommitted
Introduce Maven toolchains.
- This makes sure we use a Java 25+ JDK to comile, even though the comiled code is targeted at Java 17. - Adapt GitHub workflows for toolchain updates - Update README with instructions for building. Signed-off-by: Eric Bottard <[email protected]> Signed-off-by: ddobrin <[email protected]>
1 parent 7f30987 commit 23c838e

12 files changed

+79
-89
lines changed

.github/workflows/artifactory-milestone-release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- name: Checkout source code
1616
uses: actions/checkout@v4
1717

18-
- name: Set up JDK 17
18+
- name: Set up JDK
1919
uses: actions/setup-java@v4
2020
with:
21-
java-version: '17'
21+
java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
2222
distribution: 'temurin'
2323
cache: 'maven'
2424

@@ -27,14 +27,14 @@ jobs:
2727

2828
- name: Update release version
2929
run: |
30-
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
31-
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION -pl spring-ai-bom
30+
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
31+
./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION -pl spring-ai-bom
3232
3333
- name: Enforce release rules
34-
run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
34+
run: ./wmvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
3535

3636
- name: Build with Maven and deploy to Artifactory's milestone repository
3737
env:
3838
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
3939
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
40-
run: mvn -P artifactory-milestone -s settings.xml --batch-mode -Dmaven.test.skip=true deploy
40+
run: ./mvnw -P artifactory-milestone -s settings.xml --batch-mode -Dmaven.test.skip=true deploy

.github/workflows/continuous-inspection.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/continuous-integration.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ jobs:
4545
large-packages: false
4646
docker-images: false
4747

48-
- name: Set up JDK 17
48+
- name: Set up JDK
4949
uses: actions/setup-java@v4
5050
with:
51-
java-version: '17'
51+
java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
5252
distribution: 'temurin'
5353
cache: 'maven'
5454

@@ -73,25 +73,25 @@ jobs:
7373
# This prevents maintenance branch snapshots from conflicting with main branch artifacts
7474
run: |
7575
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
76-
./mvnw -s settings.xml -Pci-fast-integration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
76+
./mvnw -s settings.xml -ntp -Pci-fast-integration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
7777
--batch-mode --update-snapshots deploy
7878
else
79-
./mvnw -s settings.xml -Pci-fast-integration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
79+
./mvnw -s settings.xml -ntp -Pci-fast-integration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
8080
--batch-mode --update-snapshots verify
8181
fi
8282
8383
- name: Generate Java docs
8484
if: github.ref == 'refs/heads/main'
85-
run: ./mvnw --batch-mode javadoc:aggregate
85+
run: ./mvnw --batch-mode -ntp javadoc:aggregate
8686

8787
- name: Generate assembly
8888
if: github.ref == 'refs/heads/main'
8989
working-directory: spring-ai-docs
90-
run: ../mvnw --batch-mode assembly:single
90+
run: ../mvnw --batch-mode -ntp assembly:single
9191

9292
- name: Capture project version
9393
if: github.ref == 'refs/heads/main'
94-
run: echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
94+
run: echo PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
9595

9696
- name: Setup SSH key
9797
if: github.ref == 'refs/heads/main'

.github/workflows/documentation-upload.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ jobs:
1818
- name: Checkout source code
1919
uses: actions/checkout@v4
2020

21-
- name: Set up JDK 17
21+
- name: Set up JDK
2222
uses: actions/setup-java@v4
2323
with:
24-
java-version: '17'
24+
java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
2525
distribution: 'temurin'
2626
cache: 'maven'
2727

2828
- name: Generate Java docs
29-
run: ./mvnw --batch-mode clean install -DskipTests -Pjavadoc
29+
run: ./mvnw --batch-mode -ntp clean install -DskipTests -Pjavadoc
3030

3131
- name: Aggregate Java docs
32-
run: ./mvnw --batch-mode javadoc:aggregate
32+
run: ./mvnw --batch-mode -ntp javadoc:aggregate
3333

3434
- name: Generate assembly
3535
working-directory: spring-ai-docs
36-
run: mvn --batch-mode assembly:single
36+
run: ../mvnw --batch-mode -ntp assembly:single
3737

3838
- name: Setup SSH key
3939
env:

.github/workflows/fast-continuous-integration.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ jobs:
2727
large-packages: false
2828
docker-images: false
2929

30-
- name: Set up JDK 17
30+
- name: Set up JDK
3131
uses: actions/setup-java@v4
3232
with:
33-
java-version: '17'
33+
java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
3434
distribution: 'temurin'
3535
cache: 'maven'
3636

3737
- name: Build all modules with unit tests
3838
run: |
39-
./mvnw --batch-mode --update-snapshots clean install
39+
./mvnw --batch-mode -ntp --update-snapshots clean install
4040
4141
- name: Upload Maven repository
4242
uses: actions/upload-artifact@v4
@@ -62,10 +62,10 @@ jobs:
6262
- name: Checkout source code
6363
uses: actions/checkout@v4
6464

65-
- name: Set up JDK 17
65+
- name: Set up JDK
6666
uses: actions/setup-java@v4
6767
with:
68-
java-version: '17'
68+
java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
6969
distribution: 'temurin'
7070
cache: 'maven'
7171

@@ -84,7 +84,7 @@ jobs:
8484
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
8585
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
8686
run: |
87-
./mvnw --batch-mode --no-snapshot-updates \
87+
./mvnw --batch-mode -ntp --no-snapshot-updates \
8888
-pl models/spring-ai-ollama,auto-configurations/models/spring-ai-autoconfigure-model-ollama \
8989
-Pci-fast-integration-tests \
9090
-Dfailsafe.rerunFailingTestsCount=3 \
@@ -99,10 +99,10 @@ jobs:
9999
- name: Checkout source code
100100
uses: actions/checkout@v4
101101

102-
- name: Set up JDK 17
102+
- name: Set up JDK
103103
uses: actions/setup-java@v4
104104
with:
105-
java-version: '17'
105+
java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
106106
distribution: 'temurin'
107107
cache: 'maven'
108108

@@ -121,7 +121,7 @@ jobs:
121121
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
122122
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
123123
run: |
124-
./mvnw --batch-mode --no-snapshot-updates \
124+
./mvnw --batch-mode -ntp --no-snapshot-updates \
125125
-pl models/spring-ai-openai,auto-configurations/models/spring-ai-autoconfigure-model-openai \
126126
-Pci-fast-integration-tests \
127127
-Dfailsafe.rerunFailingTestsCount=3 \
@@ -136,10 +136,10 @@ jobs:
136136
- name: Checkout source code
137137
uses: actions/checkout@v4
138138

139-
- name: Set up JDK 17
139+
- name: Set up JDK
140140
uses: actions/setup-java@v4
141141
with:
142-
java-version: '17'
142+
java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
143143
distribution: 'temurin'
144144
cache: 'maven'
145145

@@ -158,7 +158,7 @@ jobs:
158158
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
159159
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
160160
run: |
161-
./mvnw --batch-mode --no-snapshot-updates \
161+
./mvnw --batch-mode -ntp --no-snapshot-updates \
162162
-pl models/spring-ai-google-genai,auto-configurations/models/spring-ai-autoconfigure-model-google-genai,mcp/common,mcp/mcp-annotations-spring,auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-common,auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-httpclient,auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-webflux,auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-common,auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webmvc,auto-configurations/mcp/spring-ai-autoconfigure-mcp-server-webflux,vector-stores/spring-ai-chroma-store,vector-stores/spring-ai-pgvector-store,spring-ai-integration-tests \
163163
-Pci-fast-integration-tests \
164164
-Dfailsafe.rerunFailingTestsCount=3 \
@@ -173,10 +173,10 @@ jobs:
173173
- name: Checkout source code
174174
uses: actions/checkout@v4
175175

176-
- name: Set up JDK 17
176+
- name: Set up JDK
177177
uses: actions/setup-java@v4
178178
with:
179-
java-version: '17'
179+
java-version: '25'
180180
distribution: 'temurin'
181181
cache: 'maven'
182182

@@ -187,11 +187,11 @@ jobs:
187187
path: ~/.m2/repository
188188

189189
- name: Generate Java docs
190-
run: ./mvnw --batch-mode javadoc:aggregate
190+
run: ./mvnw --batch-mode -ntp javadoc:aggregate
191191

192192
- name: Generate assembly
193193
working-directory: spring-ai-docs
194-
run: ../mvnw --batch-mode assembly:single
194+
run: ../mvnw --batch-mode -ntp assembly:single
195195

196196
- name: Upload Javadoc
197197
uses: actions/upload-artifact@v4
@@ -216,10 +216,10 @@ jobs:
216216
- name: Checkout source code
217217
uses: actions/checkout@v4
218218

219-
- name: Set up JDK 17
219+
- name: Set up JDK
220220
uses: actions/setup-java@v4
221221
with:
222-
java-version: '17'
222+
java-version: '25'
223223
distribution: 'temurin'
224224
cache: 'maven'
225225

@@ -234,7 +234,7 @@ jobs:
234234
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
235235
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
236236
run: |
237-
./mvnw -s settings.xml --batch-mode -DskipTests deploy
237+
./mvnw -s settings.xml --batch-mode -ntp -DskipTests deploy
238238
239239
deploy-docs:
240240
name: Deploy documentation
@@ -245,10 +245,10 @@ jobs:
245245
- name: Checkout source code
246246
uses: actions/checkout@v4
247247

248-
- name: Set up JDK 17
248+
- name: Set up JDK
249249
uses: actions/setup-java@v4
250250
with:
251-
java-version: '17'
251+
java-version: '25'
252252
distribution: 'temurin'
253253
cache: 'maven'
254254

.github/workflows/main-push-fast.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
5454
- uses: actions/setup-java@v4
5555
with:
56-
java-version: '17'
56+
java-version: '25'
5757
distribution: 'temurin'
5858
# cache: 'maven' # Disabled for fast workflow - reduces post-job noise
5959

@@ -140,9 +140,9 @@ jobs:
140140
echo "INFO: Running tests for affected modules: $MODS"
141141
# Build dependencies without tests, then test only the affected modules
142142
echo "INFO: Phase 1 - Building dependencies (this may take a few minutes)..."
143-
./mvnw -B -q -T 1C -DskipTests -pl "$MODS" -am install
143+
./mvnw -B -ntp -q -T 1C -DskipTests -pl "$MODS" -am install
144144
echo "INFO: Phase 2 - Running tests for affected modules..."
145-
./mvnw -B -q -T 1C -Pci-fast-integration-tests -DfailIfNoTests=false -pl "$MODS" verify
145+
./mvnw -B -ntp -q -T 1C -Pci-fast-integration-tests -DfailIfNoTests=false -pl "$MODS" verify
146146
echo "INFO: Testing complete"
147147
fi
148148

.github/workflows/maintenance-fast.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
- uses: actions/setup-java@v4
2222
with:
23-
java-version: '17'
23+
java-version: '25'
2424
distribution: 'temurin'
2525
cache: 'maven'
2626

@@ -92,4 +92,4 @@ jobs:
9292
echo "Check the 'Compute impacted modules' step output for debugging info"
9393
exit 1
9494
fi
95-
./mvnw -B -q -T 1C -Pintegration-tests -DfailIfNoTests=false -pl "$MODS" -amd verify
95+
./mvnw -B -ntp -q -T 1C -Pintegration-tests -DfailIfNoTests=false -pl "$MODS" -amd verify

.github/workflows/new-maven-central-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
- name: Check out sources
1414
uses: actions/checkout@v4
1515

16-
- name: Set up JDK 17
17-
uses: actions/setup-java@v3
16+
- name: Set up JDK
17+
uses: actions/setup-java@v4
1818
with:
1919
distribution: 'temurin'
20-
java-version: 17
20+
java-version: 25
2121
cache: 'maven'
2222

2323
- name: Install GPG key
@@ -31,5 +31,5 @@ jobs:
3131
CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
3232
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3333
run: |
34-
./mvnw -B clean install -DskipTests
35-
./mvnw -B clean deploy -Psonatype -s settings.xml
34+
./mvnw -B -ntp clean install -DskipTests
35+
./mvnw -B -ntp clean deploy -Psonatype -s settings.xml

.github/workflows/pr-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
- name: Checkout source code
1515
uses: actions/checkout@v4
1616

17-
- name: Set up JDK 17
17+
- name: Set up JDK
1818
uses: actions/setup-java@v4
1919
with:
20-
java-version: '17'
20+
java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
2121
distribution: 'temurin'
2222
cache: 'maven'
2323

2424
- name: Run tests
2525
run: |
26-
./mvnw --batch-mode test
26+
./mvnw -ntp -B -U test

.github/workflows/release-notes-generation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
- name: Download changelog generator
2424
run: wget https://github.com/spring-io/github-changelog-generator/releases/download/v$GENERATOR_VERSION/github-changelog-generator.jar
2525

26-
- name: Set up JDK 17
26+
- name: Set up JDK
2727
uses: actions/setup-java@v4
2828
with:
29-
java-version: '17'
29+
java-version: '25'
3030
distribution: 'temurin'
3131

3232
- name: Prepare configuration file

0 commit comments

Comments
 (0)