diff --git a/.github/workflows/artifactory-milestone-release.yml b/.github/workflows/artifactory-milestone-release.yml
index 7e08db0ea66..4043b7a94d8 100644
--- a/.github/workflows/artifactory-milestone-release.yml
+++ b/.github/workflows/artifactory-milestone-release.yml
@@ -15,10 +15,10 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
distribution: 'temurin'
cache: 'maven'
@@ -27,14 +27,14 @@ jobs:
- name: Update release version
run: |
- mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
- mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION -pl spring-ai-bom
+ ./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
+ ./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION -pl spring-ai-bom
- name: Enforce release rules
- run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
+ run: ./wmvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
- name: Build with Maven and deploy to Artifactory's milestone repository
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- run: mvn -P artifactory-milestone -s settings.xml --batch-mode -Dmaven.test.skip=true deploy
+ run: ./mvnw -P artifactory-milestone -s settings.xml --batch-mode -Dmaven.test.skip=true deploy
diff --git a/.github/workflows/continuous-inspection.yml b/.github/workflows/continuous-inspection.yml
deleted file mode 100644
index 29bd85e5302..00000000000
--- a/.github/workflows/continuous-inspection.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: Continuous inspection build
-
-on:
- schedule:
- - cron: '0 10 * * *' # Once per day at 10am UTC
- workflow_dispatch:
-
-jobs:
- code-quality-analysis:
- name: code quality analysis report
- runs-on: ubuntu-latest
- if: ${{ github.repository_owner == 'spring-projects' }}
- steps:
- - name: Checkout source code
- uses: actions/checkout@v4
-
- - name: Set up JDK 17
- uses: actions/setup-java@v4
- with:
- java-version: '17'
- distribution: 'temurin'
- cache: 'maven'
-
- - name: Analyse test coverage with Jacoco
- run: ./mvnw --batch-mode -P test-coverage verify
-
- - name: Analyse code quality with Sonar
- if: github.repository == 'spring-projects/spring-ai'
- env:
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- SONAR_HOST_URL: ${{ secrets.SONAR_URL }}
- run: ./mvnw --batch-mode sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN
-
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 41bf0a44cb3..d9462f32d11 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -45,10 +45,10 @@ jobs:
large-packages: false
docker-images: false
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
distribution: 'temurin'
cache: 'maven'
@@ -73,25 +73,25 @@ jobs:
# This prevents maintenance branch snapshots from conflicting with main branch artifacts
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
- ./mvnw -s settings.xml -Pci-fast-integration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
+ ./mvnw -s settings.xml -ntp -Pci-fast-integration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
--batch-mode --update-snapshots deploy
else
- ./mvnw -s settings.xml -Pci-fast-integration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
+ ./mvnw -s settings.xml -ntp -Pci-fast-integration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
--batch-mode --update-snapshots verify
fi
- name: Generate Java docs
if: github.ref == 'refs/heads/main'
- run: ./mvnw --batch-mode javadoc:aggregate
+ run: ./mvnw --batch-mode -ntp javadoc:aggregate
- name: Generate assembly
if: github.ref == 'refs/heads/main'
working-directory: spring-ai-docs
- run: ../mvnw --batch-mode assembly:single
+ run: ../mvnw --batch-mode -ntp assembly:single
- name: Capture project version
if: github.ref == 'refs/heads/main'
- run: echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
+ run: echo PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
- name: Setup SSH key
if: github.ref == 'refs/heads/main'
diff --git a/.github/workflows/documentation-upload.yml b/.github/workflows/documentation-upload.yml
index a6381a5c551..ed2990fa832 100644
--- a/.github/workflows/documentation-upload.yml
+++ b/.github/workflows/documentation-upload.yml
@@ -18,22 +18,22 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
distribution: 'temurin'
cache: 'maven'
- name: Generate Java docs
- run: ./mvnw --batch-mode clean install -DskipTests -Pjavadoc
+ run: ./mvnw --batch-mode -ntp clean install -DskipTests -Pjavadoc
- name: Aggregate Java docs
- run: ./mvnw --batch-mode javadoc:aggregate
+ run: ./mvnw --batch-mode -ntp javadoc:aggregate
- name: Generate assembly
working-directory: spring-ai-docs
- run: mvn --batch-mode assembly:single
+ run: ../mvnw --batch-mode -ntp assembly:single
- name: Setup SSH key
env:
diff --git a/.github/workflows/fast-continuous-integration.yml b/.github/workflows/fast-continuous-integration.yml
index 8e39fa2b7e1..ac33f2bd797 100644
--- a/.github/workflows/fast-continuous-integration.yml
+++ b/.github/workflows/fast-continuous-integration.yml
@@ -27,16 +27,16 @@ jobs:
large-packages: false
docker-images: false
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
distribution: 'temurin'
cache: 'maven'
- name: Build all modules with unit tests
run: |
- ./mvnw --batch-mode --update-snapshots clean install
+ ./mvnw --batch-mode -ntp --update-snapshots clean install
- name: Upload Maven repository
uses: actions/upload-artifact@v4
@@ -62,10 +62,10 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
distribution: 'temurin'
cache: 'maven'
@@ -84,7 +84,7 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
- ./mvnw --batch-mode --no-snapshot-updates \
+ ./mvnw --batch-mode -ntp --no-snapshot-updates \
-pl models/spring-ai-ollama,auto-configurations/models/spring-ai-autoconfigure-model-ollama \
-Pci-fast-integration-tests \
-Dfailsafe.rerunFailingTestsCount=3 \
@@ -99,10 +99,10 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
distribution: 'temurin'
cache: 'maven'
@@ -121,7 +121,7 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
- ./mvnw --batch-mode --no-snapshot-updates \
+ ./mvnw --batch-mode -ntp --no-snapshot-updates \
-pl models/spring-ai-openai,auto-configurations/models/spring-ai-autoconfigure-model-openai \
-Pci-fast-integration-tests \
-Dfailsafe.rerunFailingTestsCount=3 \
@@ -136,10 +136,10 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
distribution: 'temurin'
cache: 'maven'
@@ -158,7 +158,7 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
- ./mvnw --batch-mode --no-snapshot-updates \
+ ./mvnw --batch-mode -ntp --no-snapshot-updates \
-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 \
-Pci-fast-integration-tests \
-Dfailsafe.rerunFailingTestsCount=3 \
@@ -173,10 +173,10 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25'
distribution: 'temurin'
cache: 'maven'
@@ -187,11 +187,11 @@ jobs:
path: ~/.m2/repository
- name: Generate Java docs
- run: ./mvnw --batch-mode javadoc:aggregate
+ run: ./mvnw --batch-mode -ntp javadoc:aggregate
- name: Generate assembly
working-directory: spring-ai-docs
- run: ../mvnw --batch-mode assembly:single
+ run: ../mvnw --batch-mode -ntp assembly:single
- name: Upload Javadoc
uses: actions/upload-artifact@v4
@@ -216,10 +216,10 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25'
distribution: 'temurin'
cache: 'maven'
@@ -234,7 +234,7 @@ jobs:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
- ./mvnw -s settings.xml --batch-mode -DskipTests deploy
+ ./mvnw -s settings.xml --batch-mode -ntp -DskipTests deploy
deploy-docs:
name: Deploy documentation
@@ -245,10 +245,10 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25'
distribution: 'temurin'
cache: 'maven'
diff --git a/.github/workflows/main-push-fast.yml b/.github/workflows/main-push-fast.yml
index 845625a4c56..a19ecf322ee 100644
--- a/.github/workflows/main-push-fast.yml
+++ b/.github/workflows/main-push-fast.yml
@@ -53,7 +53,7 @@ jobs:
- uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25'
distribution: 'temurin'
# cache: 'maven' # Disabled for fast workflow - reduces post-job noise
@@ -140,9 +140,9 @@ jobs:
echo "INFO: Running tests for affected modules: $MODS"
# Build dependencies without tests, then test only the affected modules
echo "INFO: Phase 1 - Building dependencies (this may take a few minutes)..."
- ./mvnw -B -q -T 1C -DskipTests -pl "$MODS" -am install
+ ./mvnw -B -ntp -q -T 1C -DskipTests -pl "$MODS" -am install
echo "INFO: Phase 2 - Running tests for affected modules..."
- ./mvnw -B -q -T 1C -Pci-fast-integration-tests -DfailIfNoTests=false -pl "$MODS" verify
+ ./mvnw -B -ntp -q -T 1C -Pci-fast-integration-tests -DfailIfNoTests=false -pl "$MODS" verify
echo "INFO: Testing complete"
fi
diff --git a/.github/workflows/maintenance-fast.yml b/.github/workflows/maintenance-fast.yml
index 057932113b5..1a903df2144 100644
--- a/.github/workflows/maintenance-fast.yml
+++ b/.github/workflows/maintenance-fast.yml
@@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25'
distribution: 'temurin'
cache: 'maven'
@@ -92,4 +92,4 @@ jobs:
echo "Check the 'Compute impacted modules' step output for debugging info"
exit 1
fi
- ./mvnw -B -q -T 1C -Pintegration-tests -DfailIfNoTests=false -pl "$MODS" -amd verify
\ No newline at end of file
+ ./mvnw -B -ntp -q -T 1C -Pintegration-tests -DfailIfNoTests=false -pl "$MODS" -amd verify
\ No newline at end of file
diff --git a/.github/workflows/new-maven-central-release.yml b/.github/workflows/new-maven-central-release.yml
index 729508d83f9..efb41c94fa4 100644
--- a/.github/workflows/new-maven-central-release.yml
+++ b/.github/workflows/new-maven-central-release.yml
@@ -13,11 +13,11 @@ jobs:
- name: Check out sources
uses: actions/checkout@v4
- - name: Set up JDK 17
- uses: actions/setup-java@v3
+ - name: Set up JDK
+ uses: actions/setup-java@v4
with:
distribution: 'temurin'
- java-version: 17
+ java-version: 25
cache: 'maven'
- name: Install GPG key
@@ -31,5 +31,5 @@ jobs:
CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
- ./mvnw -B clean install -DskipTests
- ./mvnw -B clean deploy -Psonatype -s settings.xml
+ ./mvnw -B -ntp clean install -DskipTests
+ ./mvnw -B -ntp clean deploy -Psonatype -s settings.xml
diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml
index 7f15006d8b6..912f18392e2 100644
--- a/.github/workflows/pr-check.yml
+++ b/.github/workflows/pr-check.yml
@@ -14,13 +14,13 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25' # This action actually installs several and the toolchains plugin in maven will select 25 alright, but this makes 25 the 'default'
distribution: 'temurin'
cache: 'maven'
- name: Run tests
run: |
- ./mvnw --batch-mode test
+ ./mvnw -ntp -B -U test
diff --git a/.github/workflows/release-notes-generation.yml b/.github/workflows/release-notes-generation.yml
index fd80e41b03c..5b53cc8b0b4 100644
--- a/.github/workflows/release-notes-generation.yml
+++ b/.github/workflows/release-notes-generation.yml
@@ -23,10 +23,10 @@ jobs:
- name: Download changelog generator
run: wget https://github.com/spring-io/github-changelog-generator/releases/download/v$GENERATOR_VERSION/github-changelog-generator.jar
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: '17'
+ java-version: '25'
distribution: 'temurin'
- name: Prepare configuration file
diff --git a/README.md b/README.md
index a431b91d2d6..3d46fe45d44 100644
--- a/README.md
+++ b/README.md
@@ -71,7 +71,11 @@ To clone it you have to either:
## Building
-Build using Java 17.
+The project targets and build artifacts compatible with Java 17+, but requires a JDK 25+
+to build. This is enforced by the maven toolchains plugin and a compatible JDK should be
+automatically located on your machine if it exists, without forcing you to make it the
+default in the PATH. Please refer to the [maven toolchains plugin](https://maven.apache.org/plugins/maven-toolchains-plugin/index.html) if detection does
+not work as expected.
To build with running unit tests
diff --git a/pom.xml b/pom.xml
index 20735e98647..2986c7185a5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -343,7 +343,12 @@
4.13.1
- 3.11.0
+ 3.14.1
+ 3.2.0
+
+ [25,)
3.1.2
3.5.2
3.5.0
@@ -373,6 +378,20 @@
+
+
+
+ org.apache.maven.plugins
+ maven-toolchains-plugin
+ ${maven-toolchains-plugin.version}
+
+
+
+ select-jdk-toolchain
+
+
+
+
org.apache.maven.plugins
maven-checkstyle-plugin