Skip to content

Commit fbed55e

Browse files
authored
Merge branch 'spring-projects:main' into main
2 parents a773b28 + 21604d1 commit fbed55e

File tree

957 files changed

+12335
-13598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

957 files changed

+12335
-13598
lines changed

.github/actions/prepare-gradle-build/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ runs:
3131
${{ inputs.java-early-access == 'true' && format('{0}-ea', inputs.java-version) || inputs.java-version }}
3232
${{ inputs.java-toolchain == 'true' && '17' || '' }}
3333
- name: Set Up Gradle
34-
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
34+
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
3535
with:
3636
cache-read-only: false
3737
develocity-access-key: ${{ inputs.develocity-access-key }}
38+
develocity-token-expiry: 4
3839
- name: Configure Gradle Properties
3940
shell: bash
4041
run: |

.github/actions/sync-to-maven-central/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
using: composite
2121
steps:
2222
- name: Set Up JFrog CLI
23-
uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
23+
uses: jfrog/setup-jfrog-cli@f748a0599171a192a2668afee8d0497f7c1069df # v4.5.6
2424
env:
2525
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
2626
- name: Download Release Artifacts

.github/dco.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
require:
2+
members: false
3+

.github/workflows/build-and-deploy-snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
2222
publish: true
2323
- name: Deploy
24-
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
24+
uses: spring-io/artifactory-deploy-action@dc1913008c0599f0c4b1fdafb6ff3c502b3565ea # v0.0.2
2525
with:
2626
artifact-properties: |
2727
/**/framework-api-*.zip::zip.name=spring-framework,zip.deployed=false

.github/workflows/build-pull-request.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
timeout-minutes: 60
1111
steps:
12-
- name: Set Up JDK 17
13-
uses: actions/setup-java@v4
14-
with:
15-
distribution: 'liberica'
16-
java-version: '17'
17-
- name: Check Out
12+
- name: Check Out Code
1813
uses: actions/checkout@v4
19-
- name: Validate Gradle Wrapper
20-
uses: gradle/actions/wrapper-validation@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
21-
- name: Set Up Gradle
22-
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
2314
- name: Build
24-
env:
25-
CI: 'true'
26-
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
27-
run: ./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --no-parallel --continue build
15+
id: build
16+
uses: ./.github/actions/build
2817
- name: Print JVM Thread Dumps When Cancelled
2918
if: cancelled()
3019
uses: ./.github/actions/print-jvm-thread-dumps

.github/workflows/release-milestone.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ concurrency:
88
group: ${{ github.workflow }}-${{ github.ref }}
99
jobs:
1010
build-and-stage-release:
11-
if: ${{ github.repository == 'spring-projects/spring-framework' }}
1211
name: Build and Stage Release
12+
if: ${{ github.repository == 'spring-projects/spring-framework' }}
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Check Out Code
@@ -18,7 +18,7 @@ jobs:
1818
id: build-and-publish
1919
uses: ./.github/actions/build
2020
with:
21-
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
21+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
2222
publish: true
2323
- name: Stage Release
2424
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
@@ -41,23 +41,40 @@ jobs:
4141
name: Verify
4242
needs: build-and-stage-release
4343
uses: ./.github/workflows/verify.yml
44-
with:
45-
staging: true
46-
version: ${{ needs.build-and-stage-release.outputs.version }}
4744
secrets:
4845
google-chat-webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
4946
repository-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
5047
repository-username: ${{ secrets.ARTIFACTORY_USERNAME }}
5148
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
49+
with:
50+
staging: true
51+
version: ${{ needs.build-and-stage-release.outputs.version }}
52+
sync-to-maven-central:
53+
name: Sync to Maven Central
54+
needs:
55+
- build-and-stage-release
56+
- verify
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Check Out Code
60+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
61+
- name: Sync to Maven Central
62+
uses: ./.github/actions/sync-to-maven-central
63+
with:
64+
jfrog-cli-config-token: ${{ secrets.JF_ARTIFACTORY_SPRING }}
65+
ossrh-s01-staging-profile: ${{ secrets.OSSRH_S01_STAGING_PROFILE }}
66+
ossrh-s01-token-password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
67+
ossrh-s01-token-username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
68+
spring-framework-version: ${{ needs.build-and-stage-release.outputs.version }}
5269
promote-release:
5370
name: Promote Release
5471
needs:
5572
- build-and-stage-release
56-
- verify
73+
- sync-to-maven-central
5774
runs-on: ubuntu-latest
5875
steps:
5976
- name: Set up JFrog CLI
60-
uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
77+
uses: jfrog/setup-jfrog-cli@dff217c085c17666e8849ebdbf29c8fe5e3995e6 # v4.5.2
6178
env:
6279
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
6380
- name: Promote build

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
2121
publish: true
2222
- name: Stage Release
23-
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
23+
uses: spring-io/artifactory-deploy-action@dc1913008c0599f0c4b1fdafb6ff3c502b3565ea # v0.0.2
2424
with:
2525
artifact-properties: |
2626
/**/framework-api-*.zip::zip.name=spring-framework,zip.deployed=false
@@ -73,7 +73,7 @@ jobs:
7373
runs-on: ubuntu-latest
7474
steps:
7575
- name: Set up JFrog CLI
76-
uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
76+
uses: jfrog/setup-jfrog-cli@dff217c085c17666e8849ebdbf29c8fe5e3995e6 # v4.5.2
7777
env:
7878
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
7979
- name: Promote build

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
distribution: 'liberica'
4747
java-version: 17
4848
- name: Set Up Gradle
49-
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
49+
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
5050
with:
5151
cache-read-only: false
5252
- name: Configure Gradle Properties

.sdkmanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Enable auto-env through the sdkman_auto_env config
22
# Add key=value pairs of SDKs to use below
3-
java=17.0.12-librca
3+
java=23.0.1-librca

CONTRIBUTING.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ First off, thank you for taking the time to contribute! :+1: :tada:
1616

1717
### Code of Conduct
1818

19-
This project is governed by the [Spring Code of Conduct](CODE_OF_CONDUCT.adoc).
19+
This project is governed by the [Spring Code of Conduct](https://github.com/spring-projects/spring-framework#coc-ov-file).
2020
By participating you are expected to uphold this code.
2121
Please report unacceptable behavior to spring-code-of-conduct@spring.io.
2222

@@ -65,10 +65,6 @@ follow-up reports will need to be created as new issues with a fresh description
6565

6666
#### Submit a Pull Request
6767

68-
1. If you have not previously done so, please sign the
69-
[Contributor License Agreement](https://cla.spring.io/sign/spring). You will be reminded
70-
automatically when you submit the PR.
71-
7268
1. Should you create an issue first? No, just create the pull request and use the
7369
description to provide context and motivation, as you would for an issue. If you want
7470
to start a discussion first or have already created an issue, once a pull request is
@@ -85,6 +81,11 @@ multiple edits or corrections of the same logical change. See
8581
[Rewriting History section of Pro Git](https://git-scm.com/book/en/Git-Tools-Rewriting-History)
8682
for an overview of streamlining the commit history.
8783

84+
1. All commits must include a _Signed-off-by_ trailer at the end of each commit message
85+
to indicate that the contributor agrees to the Developer Certificate of Origin.
86+
For additional details, please refer to the blog post
87+
[Hello DCO, Goodbye CLA: Simplifying Contributions to Spring](https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring).
88+
8889
1. Format commit messages using 55 characters for the subject line, 72 characters per line
8990
for the description, followed by the issue fixed, for example, `Closes gh-22276`. See the
9091
[Commit Guidelines section of Pro Git](https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines)

build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
id 'io.github.goooler.shadow' version '8.1.8' apply false
1010
id 'me.champeau.jmh' version '0.7.2' apply false
1111
id 'me.champeau.mrjar' version '0.1.1'
12-
id "net.ltgt.errorprone" version "3.1.0" apply false
12+
id "net.ltgt.errorprone" version "4.1.0" apply false
1313
}
1414

1515
ext {
@@ -80,16 +80,13 @@ configure([rootProject] + javaProjects) { project ->
8080
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
8181
testRuntimeOnly("org.junit.platform:junit-platform-suite-engine")
8282
testRuntimeOnly("org.apache.logging.log4j:log4j-core")
83-
// JSR-305 only used for non-required meta-annotations
84-
compileOnly("com.google.code.findbugs:jsr305")
85-
testCompileOnly("com.google.code.findbugs:jsr305")
8683
}
8784

8885
ext.javadocLinks = [
8986
"https://docs.oracle.com/en/java/javase/17/docs/api/",
9087
"https://jakarta.ee/specifications/platform/11/apidocs/",
9188
"https://docs.jboss.org/hibernate/orm/5.6/javadocs/",
92-
"https://eclipse.dev/aspectj/doc/released/aspectj5rt-api",
89+
"https://eclipse.dev/aspectj/doc/latest/runtime-api/",
9390
"https://www.quartz-scheduler.org/api/2.3.0/",
9491
"https://fasterxml.github.io/jackson-core/javadoc/2.14/",
9592
"https://fasterxml.github.io/jackson-databind/javadoc/2.14/",

buildSrc/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ The `org.springframework.build.conventions` plugin applies all conventions to th
99

1010
* Configuring the Java compiler, see `JavaConventions`
1111
* Configuring the Kotlin compiler, see `KotlinConventions`
12-
* Configuring testing in the build with `TestConventions`
12+
* Configuring testing in the build with `TestConventions`
13+
* Configuring the ArchUnit rules for the project, see `org.springframework.build.architecture.ArchitectureRules`
1314

1415
This plugin also provides a DSL extension to optionally enable Java preview features for
1516
compiling and testing sources in a module. This can be applied with the following in a

buildSrc/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ ext {
2020
dependencies {
2121
checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}"
2222
implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
23+
implementation "com.tngtech.archunit:archunit:1.3.0"
2324
implementation "org.gradle:test-retry-gradle-plugin:1.5.6"
2425
implementation "io.spring.javaformat:spring-javaformat-gradle-plugin:${javaFormatVersion}"
2526
implementation "io.spring.nohttp:nohttp-gradle:0.0.11"
2627
}
2728

2829
gradlePlugin {
2930
plugins {
31+
architecturePlugin {
32+
id = "org.springframework.architecture"
33+
implementationClass = "org.springframework.build.architecture.ArchitecturePlugin"
34+
}
3035
conventionsPlugin {
3136
id = "org.springframework.build.conventions"
3237
implementationClass = "org.springframework.build.ConventionsPlugin"

buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ public void apply(Project project) {
5050
project.getPlugins().apply(CheckstylePlugin.class);
5151
project.getTasks().withType(Checkstyle.class).forEach(checkstyle -> checkstyle.getMaxHeapSize().set("1g"));
5252
CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class);
53-
checkstyle.setToolVersion("10.20.2");
53+
checkstyle.setToolVersion("10.21.2");
5454
checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle"));
5555
String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion();
5656
DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies();
@@ -64,7 +64,7 @@ private static void configureNoHttpPlugin(Project project) {
6464
NoHttpExtension noHttp = project.getExtensions().getByType(NoHttpExtension.class);
6565
noHttp.setAllowlistFile(project.file("src/nohttp/allowlist.lines"));
6666
noHttp.getSource().exclude("**/test-output/**", "**/.settings/**",
67-
"**/.classpath", "**/.project", "**/.gradle/**", "**/node_modules/**");
67+
"**/.classpath", "**/.project", "**/.gradle/**", "**/node_modules/**", "**/spring-jcl/**");
6868
List<String> buildFolders = List.of("bin", "build", "out");
6969
project.allprojects(subproject -> {
7070
Path rootPath = project.getRootDir().toPath();

buildSrc/src/main/java/org/springframework/build/ConventionsPlugin.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121
import org.gradle.api.plugins.JavaBasePlugin;
2222
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin;
2323

24+
import org.springframework.build.architecture.ArchitecturePlugin;
25+
2426
/**
2527
* Plugin to apply conventions to projects that are part of Spring Framework's build.
2628
* Conventions are applied in response to various plugins being applied.
2729
*
2830
* <p>When the {@link JavaBasePlugin} is applied, the conventions in {@link CheckstyleConventions},
2931
* {@link TestConventions} and {@link JavaConventions} are applied.
32+
* The {@link ArchitecturePlugin} plugin is also applied.
3033
* When the {@link KotlinBasePlugin} is applied, the conventions in {@link KotlinConventions}
3134
* are applied.
3235
*
@@ -37,6 +40,7 @@ public class ConventionsPlugin implements Plugin<Project> {
3740
@Override
3841
public void apply(Project project) {
3942
project.getExtensions().create("springFramework", SpringFrameworkExtension.class);
43+
new ArchitecturePlugin().apply(project);
4044
new CheckstyleConventions().apply(project);
4145
new JavaConventions().apply(project);
4246
new KotlinConventions().apply(project);

buildSrc/src/main/java/org/springframework/build/JavaConventions.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -73,7 +73,7 @@ public void apply(Project project) {
7373
private void applyJavaCompileConventions(Project project) {
7474
project.getExtensions().getByType(JavaPluginExtension.class).toolchain(toolchain -> {
7575
toolchain.getVendor().set(JvmVendorSpec.BELLSOFT);
76-
toolchain.getLanguageVersion().set(JavaLanguageVersion.of(17));
76+
toolchain.getLanguageVersion().set(JavaLanguageVersion.of(23));
7777
});
7878
SpringFrameworkExtension frameworkExtension = project.getExtensions().getByType(SpringFrameworkExtension.class);
7979
project.afterEvaluate(p -> {
@@ -83,6 +83,7 @@ private void applyJavaCompileConventions(Project project) {
8383
compileTask.getOptions().setCompilerArgs(COMPILER_ARGS);
8484
compileTask.getOptions().getCompilerArgumentProviders().add(frameworkExtension.asArgumentProvider());
8585
compileTask.getOptions().setEncoding("UTF-8");
86+
setJavaRelease(compileTask);
8687
});
8788
p.getTasks().withType(JavaCompile.class)
8889
.matching(compileTask -> compileTask.getName().startsWith(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME)
@@ -91,9 +92,23 @@ private void applyJavaCompileConventions(Project project) {
9192
compileTask.getOptions().setCompilerArgs(TEST_COMPILER_ARGS);
9293
compileTask.getOptions().getCompilerArgumentProviders().add(frameworkExtension.asArgumentProvider());
9394
compileTask.getOptions().setEncoding("UTF-8");
95+
setJavaRelease(compileTask);
9496
});
9597

9698
});
9799
}
98100

101+
private void setJavaRelease(JavaCompile task) {
102+
int defaultVersion = 17;
103+
int releaseVersion = defaultVersion;
104+
int compilerVersion = task.getJavaCompiler().get().getMetadata().getLanguageVersion().asInt();
105+
for (int version = defaultVersion ; version <= compilerVersion ; version++) {
106+
if (task.getName().contains("Java" + version)) {
107+
releaseVersion = version;
108+
break;
109+
}
110+
}
111+
task.getOptions().getRelease().set(releaseVersion);
112+
}
113+
99114
}

buildSrc/src/main/java/org/springframework/build/KotlinConventions.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,12 @@ private void configure(KotlinCompile compile) {
3939
options.getJvmTarget().set(JvmTarget.JVM_17);
4040
options.getJavaParameters().set(true);
4141
options.getAllWarningsAsErrors().set(true);
42-
options.getFreeCompilerArgs().addAll("-Xsuppress-version-warnings", "-Xjsr305=strict", "-opt-in=kotlin.RequiresOptIn");
42+
options.getFreeCompilerArgs().addAll(
43+
"-Xsuppress-version-warnings",
44+
"-Xjsr305=strict", // For dependencies using JSR 305
45+
"-opt-in=kotlin.RequiresOptIn",
46+
"-Xjdk-release=17" // Needed due to https://youtrack.jetbrains.com/issue/KT-49746
47+
);
4348
});
4449
}
4550

buildSrc/src/main/java/org/springframework/build/TestConventions.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,10 +54,7 @@ private void configureTests(Project project, Test test) {
5454
test.include("**/*Tests.class", "**/*Test.class");
5555
test.setSystemProperties(Map.of(
5656
"java.awt.headless", "true",
57-
"io.netty.leakDetection.level", "paranoid",
58-
"io.netty5.leakDetectionLevel", "paranoid",
59-
"io.netty5.leakDetection.targetRecords", "32",
60-
"io.netty5.buffer.lifecycleTracingEnabled", "true"
57+
"io.netty.leakDetection.level", "paranoid"
6158
));
6259
if (project.hasProperty("testGroups")) {
6360
test.systemProperty("testGroups", project.getProperties().get("testGroups"));

0 commit comments

Comments
 (0)