Skip to content

Commit 3193e26

Browse files
authored
Merge branch 'spring-projects:main' into master
2 parents 1c33681 + e5ee369 commit 3193e26

File tree

1,211 files changed

+81140
-69047
lines changed

Some content is hidden

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

1,211 files changed

+81140
-69047
lines changed

.github/workflows/deploy-docs.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches-ignore: [ gh-pages ]
5+
tags: '**'
6+
repository_dispatch:
7+
types: request-build-reference # legacy
8+
schedule:
9+
- cron: '0 10 * * *' # Once per day at 10am UTC
10+
workflow_dispatch:
11+
permissions:
12+
actions: write
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
if: github.repository_owner == 'spring-projects'
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
ref: docs-build
22+
fetch-depth: 1
23+
- name: Dispatch (partial build)
24+
if: github.ref_type == 'branch'
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
28+
- name: Dispatch (full build)
29+
if: github.ref_type == 'tag'
30+
env:
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

.sdkmanrc

+1-1
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.6-librca
3+
java=17.0.7-librca

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Information regarding CI builds can be found in the [Spring Framework Concourse
3131

3232
## Stay in Touch
3333

34-
Follow [@SpringCentral](https://twitter.com/springcentral), [@SpringFramework](https://twitter.com/springframework), and its [team members](https://twitter.com/springframework/lists/team/members) on Twitter. In-depth articles can be found at [The Spring Blog](https://spring.io/blog/), and releases are announced via our [news feed](https://spring.io/blog/category/news).
34+
Follow [@SpringCentral](https://twitter.com/springcentral), [@SpringFramework](https://twitter.com/springframework), and its [team members](https://twitter.com/springframework/lists/team/members) on Twitter. In-depth articles can be found at [The Spring Blog](https://spring.io/blog/), and releases are announced via our [releases feed](https://spring.io/blog/category/releases).
3535

3636
## License
3737

build.gradle

+16-69
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
plugins {
2-
id 'io.spring.nohttp' version '0.0.11'
3-
id 'io.freefair.aspectj' version '6.5.0.3' apply false
2+
id 'io.freefair.aspectj' version '8.0.1' apply false
43
// kotlinVersion is managed in gradle.properties
54
id 'org.jetbrains.kotlin.plugin.serialization' version "${kotlinVersion}" apply false
6-
id 'org.jetbrains.dokka' version '1.7.20'
5+
id 'org.jetbrains.dokka' version '1.8.10'
76
id 'org.asciidoctor.jvm.convert' version '3.3.2' apply false
87
id 'org.asciidoctor.jvm.pdf' version '3.3.2' apply false
98
id 'org.unbroken-dome.xjc' version '2.0.0' apply false
10-
id 'com.github.ben-manes.versions' version '0.42.0'
11-
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
12-
id 'de.undercouch.download' version '5.1.0'
13-
id 'me.champeau.jmh' version '0.6.8' apply false
9+
id 'com.github.ben-manes.versions' version '0.46.0'
10+
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
11+
id 'de.undercouch.download' version '5.4.0'
12+
id 'me.champeau.jmh' version '0.7.0' apply false
13+
id 'me.champeau.mrjar' version '0.1.1'
1414
}
1515

1616
ext {
@@ -49,7 +49,6 @@ configure([rootProject] + javaProjects) { project ->
4949

5050
apply plugin: "java"
5151
apply plugin: "java-test-fixtures"
52-
apply plugin: "checkstyle"
5352
apply plugin: 'org.springframework.build.conventions'
5453
apply from: "${rootDir}/gradle/toolchains.gradle"
5554
apply from: "${rootDir}/gradle/ide.gradle"
@@ -63,33 +62,6 @@ configure([rootProject] + javaProjects) { project ->
6362
matching { it.name.endsWith("Classpath") }.all { it.extendsFrom(dependencyManagement) }
6463
}
6564

66-
test {
67-
useJUnitPlatform()
68-
include(["**/*Tests.class", "**/*Test.class"])
69-
systemProperty("java.awt.headless", "true")
70-
systemProperty("testGroups", project.properties.get("testGroups"))
71-
systemProperty("io.netty.leakDetection.level", "paranoid")
72-
systemProperty("io.netty5.leakDetectionLevel", "paranoid")
73-
systemProperty("io.netty5.leakDetection.targetRecords", "32")
74-
systemProperty("io.netty5.buffer.lifecycleTracingEnabled", "true")
75-
systemProperty("io.netty5.buffer.leakDetectionEnabled", "true")
76-
jvmArgs(["--add-opens=java.base/java.lang=ALL-UNNAMED",
77-
"--add-opens=java.base/java.util=ALL-UNNAMED"])
78-
}
79-
80-
checkstyle {
81-
toolVersion = "10.9.1"
82-
configDirectory.set(rootProject.file("src/checkstyle"))
83-
}
84-
85-
tasks.named("checkstyleMain").configure {
86-
maxHeapSize = "1g"
87-
}
88-
89-
tasks.named("checkstyleTest").configure {
90-
maxHeapSize = "1g"
91-
}
92-
9365
dependencies {
9466
dependencyManagement(enforcedPlatform(dependencies.project(path: ":framework-platform")))
9567
testImplementation("org.junit.jupiter:junit-jupiter-api")
@@ -105,20 +77,19 @@ configure([rootProject] + javaProjects) { project ->
10577
testRuntimeOnly("org.junit.platform:junit-platform-suite-engine")
10678
testRuntimeOnly("org.apache.logging.log4j:log4j-core")
10779
testRuntimeOnly("org.apache.logging.log4j:log4j-jul")
108-
testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl")
80+
testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j2-impl")
10981
// JSR-305 only used for non-required meta-annotations
11082
compileOnly("com.google.code.findbugs:jsr305")
11183
testCompileOnly("com.google.code.findbugs:jsr305")
112-
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.31")
11384
}
11485

11586
ext.javadocLinks = [
11687
"https://docs.oracle.com/en/java/javase/17/docs/api/",
11788
"https://jakarta.ee/specifications/platform/9/apidocs/",
118-
"https://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ
119-
"https://www.ibm.com/docs/api/v1/content/SSEQTP_8.5.5/com.ibm.websphere.javadoc.doc/web/apidocs/",
120-
"https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
121-
"https://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
89+
"https://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ and weblogic.* packages
90+
"https://www.ibm.com/docs/api/v1/content/SSEQTP_8.5.5/com.ibm.websphere.javadoc.doc/web/apidocs/", // com.ibm.*
91+
"https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/", // org.jboss.resource.*
92+
"https://docs.jboss.org/hibernate/orm/5.6/javadocs/",
12293
"https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
12394
"https://www.quartz-scheduler.org/api/2.3.0/",
12495
"https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.14.1/",
@@ -130,15 +101,13 @@ configure([rootProject] + javaProjects) { project ->
130101
// TODO Uncomment link to JUnit 5 docs once we execute Gradle with Java 18+.
131102
// See https://github.com/spring-projects/spring-framework/issues/27497
132103
//
133-
// "https://junit.org/junit5/docs/5.9.2/api/",
104+
// "https://junit.org/junit5/docs/5.9.3/api/",
134105
"https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/",
135106
"https://javadoc.io/static/io.rsocket/rsocket-core/1.1.1/",
136107
"https://r2dbc.io/spec/1.0.0.RELEASE/api/",
137-
// The external Javadoc link for JSR 305 must come last to ensure that types from
138-
// JSR 250 (such as @PostConstruct) are still supported. This is due to the fact
139-
// that JSR 250 and JSR 305 both define types in javax.annotation, which results
140-
// in a split package, and the javadoc tool does not support split packages
141-
// across multiple external Javadoc sites.
108+
// Previously there could be a split-package issue between JSR250 and JSR305 javax.annotation packages,
109+
// but since 6.0 JSR 250 annotations such as @Resource and @PostConstruct have been replaced by their
110+
// JakartaEE equivalents in the jakarta.annotation package.
142111
"https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.2/"
143112
] as String[]
144113
}
@@ -149,27 +118,5 @@ configure(moduleProjects) { project ->
149118

150119
configure(rootProject) {
151120
description = "Spring Framework"
152-
153-
apply plugin: "io.spring.nohttp"
154121
apply plugin: 'org.springframework.build.api-diff'
155-
156-
nohttp {
157-
source.exclude "**/test-output/**"
158-
allowlistFile = project.file("src/nohttp/allowlist.lines")
159-
def rootPath = file(rootDir).toPath()
160-
def projectDirs = allprojects.collect { it.projectDir } + "${rootDir}/buildSrc"
161-
projectDirs.forEach { dir ->
162-
[ 'bin', 'build', 'out', '.settings' ]
163-
.collect { rootPath.relativize(new File(dir, it).toPath()) }
164-
.forEach { source.exclude "$it/**" }
165-
[ '.classpath', '.project' ]
166-
.collect { rootPath.relativize(new File(dir, it).toPath()) }
167-
.forEach { source.exclude "$it" }
168-
}
169-
}
170-
171-
tasks.named("checkstyleNohttp").configure {
172-
maxHeapSize = "1g"
173-
}
174-
175122
}

buildSrc/build.gradle

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
plugins {
22
id 'java-gradle-plugin'
3+
id 'checkstyle'
4+
id 'io.spring.javaformat' version "${javaFormatVersion}"
35
}
46

57
repositories {
@@ -17,10 +19,13 @@ ext {
1719
}
1820

1921
dependencies {
20-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
21-
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:${kotlinVersion}")
22+
checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}"
23+
implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
24+
implementation "org.jetbrains.kotlin:kotlin-compiler-embeddable:${kotlinVersion}"
2225
implementation "me.champeau.gradle:japicmp-gradle-plugin:0.3.0"
2326
implementation "org.gradle:test-retry-gradle-plugin:1.4.1"
27+
implementation "io.spring.javaformat:spring-javaformat-gradle-plugin:${javaFormatVersion}"
28+
implementation "io.spring.nohttp:nohttp-gradle:0.0.11"
2429
}
2530

2631
gradlePlugin {

buildSrc/gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
org.gradle.caching=true
2+
javaFormatVersion=0.0.38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* Copyright 2002-2023 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.build;
18+
19+
import io.spring.javaformat.gradle.SpringJavaFormatPlugin;
20+
import io.spring.nohttp.gradle.NoHttpExtension;
21+
import io.spring.nohttp.gradle.NoHttpPlugin;
22+
import org.gradle.api.Plugin;
23+
import org.gradle.api.Project;
24+
import org.gradle.api.artifacts.DependencySet;
25+
import org.gradle.api.plugins.JavaBasePlugin;
26+
import org.gradle.api.plugins.quality.Checkstyle;
27+
import org.gradle.api.plugins.quality.CheckstyleExtension;
28+
import org.gradle.api.plugins.quality.CheckstylePlugin;
29+
30+
import java.io.File;
31+
import java.nio.file.Path;
32+
import java.util.List;
33+
34+
/**
35+
* {@link Plugin} that applies conventions for checkstyle.
36+
* @author Brian Clozel
37+
*/
38+
public class CheckstyleConventions {
39+
40+
/**
41+
* Applies the Spring Java Format and Checkstyle plugins with the project conventions.
42+
* @param project the current project
43+
*/
44+
public void apply(Project project) {
45+
project.getPlugins().withType(JavaBasePlugin.class, (java) -> {
46+
if (project.getRootProject() == project) {
47+
configureNoHttpPlugin(project);
48+
}
49+
project.getPlugins().apply(CheckstylePlugin.class);
50+
project.getTasks().withType(Checkstyle.class).forEach(checkstyle -> checkstyle.getMaxHeapSize().set("1g"));
51+
CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class);
52+
checkstyle.setToolVersion("10.10.0");
53+
checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle"));
54+
String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion();
55+
DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies();
56+
checkstyleDependencies
57+
.add(project.getDependencies().create("io.spring.javaformat:spring-javaformat-checkstyle:" + version));
58+
});
59+
}
60+
61+
private static void configureNoHttpPlugin(Project project) {
62+
project.getPlugins().apply(NoHttpPlugin.class);
63+
NoHttpExtension noHttp = project.getExtensions().getByType(NoHttpExtension.class);
64+
noHttp.setAllowlistFile(project.file("src/nohttp/allowlist.lines"));
65+
noHttp.getSource().exclude("**/test-output/**", "**/.settings/**",
66+
"**/.classpath", "**/.project", "**/.gradle/**");
67+
List<String> buildFolders = List.of("bin", "build", "out");
68+
project.allprojects(subproject -> {
69+
Path rootPath = project.getRootDir().toPath();
70+
Path projectPath = rootPath.relativize(subproject.getProjectDir().toPath());
71+
for (String buildFolder : buildFolders) {
72+
Path innerBuildDir = projectPath.resolve(buildFolder);
73+
noHttp.getSource().exclude(innerBuildDir + File.separator + "**");
74+
}
75+
});
76+
}
77+
78+
}

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -25,10 +25,8 @@
2525
* Plugin to apply conventions to projects that are part of Spring Framework's build.
2626
* Conventions are applied in response to various plugins being applied.
2727
*
28-
* When the {@link JavaBasePlugin} is applied, the conventions in {@link TestConventions}
29-
* are applied.
30-
* When the {@link JavaBasePlugin} is applied, the conventions in {@link JavaConventions}
31-
* are applied.
28+
* When the {@link JavaBasePlugin} is applied, the conventions in {@link CheckstyleConventions},
29+
* {@link TestConventions} and {@link JavaConventions} are applied.
3230
* When the {@link KotlinBasePlugin} is applied, the conventions in {@link KotlinConventions}
3331
* are applied.
3432
*
@@ -38,6 +36,7 @@ public class ConventionsPlugin implements Plugin<Project> {
3836

3937
@Override
4038
public void apply(Project project) {
39+
new CheckstyleConventions().apply(project);
4140
new JavaConventions().apply(project);
4241
new KotlinConventions().apply(project);
4342
new TestConventions().apply(project);

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -24,7 +24,9 @@
2424
import org.gradle.api.Project;
2525
import org.gradle.api.plugins.JavaBasePlugin;
2626
import org.gradle.api.plugins.JavaPlugin;
27+
import org.gradle.api.plugins.JavaPluginExtension;
2728
import org.gradle.api.tasks.compile.JavaCompile;
29+
import org.gradle.jvm.toolchain.JavaLanguageVersion;
2830

2931
/**
3032
* {@link Plugin} that applies conventions for compiling Java sources in Spring Framework.
@@ -68,6 +70,8 @@ public void apply(Project project) {
6870
* @param project the current project
6971
*/
7072
private void applyJavaCompileConventions(Project project) {
73+
project.getExtensions().getByType(JavaPluginExtension.class)
74+
.getToolchain().getLanguageVersion().set(JavaLanguageVersion.of(17));
7175
project.getTasks().withType(JavaCompile.class)
7276
.matching(compileTask -> compileTask.getName().equals(JavaPlugin.COMPILE_JAVA_TASK_NAME))
7377
.forEach(compileTask -> {

0 commit comments

Comments
 (0)