Skip to content

Commit 0ccaa99

Browse files
authored
Merge branch 'spring-projects:main' into add-support-autoconfiguration-for-static-master-replica
2 parents da167ad + c1d51f8 commit 0ccaa99

File tree

1,099 files changed

+14092
-12907
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,099 files changed

+14092
-12907
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ runs:
3434
tool-cache: true
3535
docker-images: false
3636
- name: Set Up Java
37-
uses: actions/setup-java@v4
37+
uses: actions/setup-java@v5
3838
with:
3939
distribution: ${{ inputs.java-early-access == 'true' && 'temurin' || (inputs.java-distribution || 'liberica') }}
4040
java-version: |
4141
${{ inputs.java-early-access == 'true' && format('{0}-ea', inputs.java-version) || inputs.java-version }}
4242
${{ inputs.java-toolchain == 'true' && '24' || '' }}
4343
- name: Set Up Gradle With Read/Write Cache
4444
if: ${{ inputs.cache-read-only == 'false' }}
45-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
45+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
4646
with:
4747
cache-read-only: false
4848
develocity-access-key: ${{ inputs.develocity-access-key }}
4949
- name: Set Up Gradle
50-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
50+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
5151
with:
5252
develocity-access-key: ${{ inputs.develocity-access-key }}
5353
develocity-token-expiry: 4

.github/actions/publish-gradle-plugin/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ runs:
2121
using: composite
2222
steps:
2323
- name: Set Up JFrog CLI
24-
uses: jfrog/setup-jfrog-cli@2bc6e55719cd37dfb2f655a1e4f16c3440182a9f # v4.5.13
24+
uses: jfrog/setup-jfrog-cli@88e9eba31c07e31beefa4cef5c0e93d1af9535d7 # v4.6.1
2525
env:
2626
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
2727
- name: Download Artifacts
2828
shell: bash
2929
run: jf rt download --spec ${{ format('{0}/artifacts.spec', github.action_path) }} --spec-vars 'buildName=${{ format('spring-boot-{0}', inputs.plugin-version) }};buildNumber=${{ inputs.build-number }}'
3030
- name: Set Up Java
31-
uses: actions/setup-java@v4
31+
uses: actions/setup-java@v5
3232
with:
3333
distribution: 'liberica'
3434
java-version: '17'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
using: composite
1818
steps:
1919
- name: Set Up JFrog CLI
20-
uses: jfrog/setup-jfrog-cli@2bc6e55719cd37dfb2f655a1e4f16c3440182a9f # v4.5.13
20+
uses: jfrog/setup-jfrog-cli@88e9eba31c07e31beefa4cef5c0e93d1af9535d7 # v4.6.1
2121
env:
2222
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
2323
- name: Download Release Artifacts

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ updates:
66
interval: "weekly"
77
labels:
88
- "type: task"
9+
- "status: waiting-for-triage"
10+
- package-ecosystem: "npm"
11+
directory: "/antora"
12+
schedule:
13+
interval: "weekly"
14+
labels:
15+
- "type: task"
16+
- "status: waiting-for-triage"

.github/workflows/release-milestone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
7676
steps:
7777
- name: Set up JFrog CLI
78-
uses: jfrog/setup-jfrog-cli@2bc6e55719cd37dfb2f655a1e4f16c3440182a9f # v4.5.13
78+
uses: jfrog/setup-jfrog-cli@88e9eba31c07e31beefa4cef5c0e93d1af9535d7 # v4.6.1
7979
env:
8080
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
8181
- name: Promote build

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
8787
steps:
8888
- name: Set up JFrog CLI
89-
uses: jfrog/setup-jfrog-cli@2bc6e55719cd37dfb2f655a1e4f16c3440182a9f # v4.5.13
89+
uses: jfrog/setup-jfrog-cli@88e9eba31c07e31beefa4cef5c0e93d1af9535d7 # v4.6.1
9090
env:
9191
JF_ENV_SPRING: ${{ vars.COMMERCIAL && secrets.COMMERCIAL_JF_ARTIFACTORY_SPRING || secrets.JF_ARTIFACTORY_SPRING }}
9292
- name: Promote open source build

.github/workflows/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
path: send-notification
5050
sparse-checkout: .github/actions/send-notification
5151
- name: Set Up Java
52-
uses: actions/setup-java@v4
52+
uses: actions/setup-java@v5
5353
with:
5454
distribution: 'liberica'
5555
java-version: 17
@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
stable: true
6161
- name: Set Up Gradle
62-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
62+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
6363
with:
6464
cache-read-only: false
6565
- name: Configure Gradle Properties

build-plugin/spring-boot-gradle-plugin/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ dependencies {
5959

6060
testImplementation(project(":test-support:spring-boot-gradle-test-support"))
6161
testImplementation(project(":test-support:spring-boot-test-support"))
62-
testImplementation("com.fasterxml.jackson.core:jackson-databind")
63-
testImplementation("com.fasterxml.jackson.module:jackson-module-parameter-names")
6462
testImplementation("com.tngtech.archunit:archunit-junit5:1.4.0")
6563
testImplementation("net.java.dev.jna:jna-platform")
6664
testImplementation("org.apache.commons:commons-compress")
@@ -70,6 +68,7 @@ dependencies {
7068
testImplementation("org.jetbrains.kotlin:kotlin-compiler-runner:$kotlinVersion")
7169
testImplementation("org.jetbrains.kotlin:kotlin-daemon-client:$kotlinVersion")
7270
testImplementation("org.tomlj:tomlj:1.0.0")
71+
testImplementation("tools.jackson.core:jackson-databind")
7372
}
7473

7574
repositories {

build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.boot.gradle.plugin;
1818

1919
import java.io.IOException;
20+
import java.io.InputStream;
2021
import java.io.InputStreamReader;
2122
import java.io.StringWriter;
2223
import java.util.concurrent.Callable;
@@ -38,6 +39,7 @@
3839
import org.gradle.util.GradleVersion;
3940

4041
import org.springframework.boot.gradle.tasks.run.BootRun;
42+
import org.springframework.util.Assert;
4143

4244
/**
4345
* Action that is executed in response to the {@link ApplicationPlugin} being applied.
@@ -110,7 +112,7 @@ public Class<? extends Plugin<Project>> getPluginClass() {
110112
}
111113

112114
private String loadResource(String name) {
113-
try (InputStreamReader reader = new InputStreamReader(getClass().getResourceAsStream(name))) {
115+
try (InputStreamReader reader = new InputStreamReader(getResourceAsStream(name))) {
114116
char[] buffer = new char[4096];
115117
int read;
116118
StringWriter writer = new StringWriter();
@@ -124,6 +126,12 @@ private String loadResource(String name) {
124126
}
125127
}
126128

129+
private InputStream getResourceAsStream(String name) {
130+
InputStream stream = getClass().getResourceAsStream(name);
131+
Assert.state(stream != null, "Resource '%s' not found'".formatted(name));
132+
return stream;
133+
}
134+
127135
private void configureFilePermissions(CopySpec copySpec, int mode) {
128136
if (GradleVersion.current().compareTo(GradleVersion.version("8.3")) >= 0) {
129137
copySpec.filePermissions((filePermissions) -> filePermissions.unix(Integer.toString(mode, 8)));

build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoProperties.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public abstract class BuildInfoProperties implements Serializable {
4848

4949
private final SetProperty<String> excludes;
5050

51-
private final Supplier<String> creationTime = () -> DateTimeFormatter.ISO_INSTANT.format(Instant.now());
51+
private final Supplier<@Nullable String> creationTime = () -> DateTimeFormatter.ISO_INSTANT.format(Instant.now());
5252

5353
@Inject
5454
public BuildInfoProperties(Project project, SetProperty<String> excludes) {
@@ -143,14 +143,18 @@ Map<String, String> getAdditionalIfNotExcluded() {
143143
}
144144

145145
private <T> @Nullable T getIfNotExcluded(Property<T> property, String name) {
146-
return getIfNotExcluded(property, name, () -> null);
146+
Supplier<@Nullable T> supplier = () -> null;
147+
return getIfNotExcluded(property, name, supplier);
147148
}
148149

149-
private <T> @Nullable T getIfNotExcluded(Property<T> property, String name, Supplier<T> defaultValue) {
150+
private <T> @Nullable T getIfNotExcluded(Property<T> property, String name, Supplier<@Nullable T> defaultValue) {
150151
if (this.excludes.getOrElse(Collections.emptySet()).contains(name)) {
151152
return null;
152153
}
153-
return property.getOrElse(defaultValue.get());
154+
if (property.isPresent()) {
155+
return property.get();
156+
}
157+
return defaultValue.get();
154158
}
155159

156160
private Map<String, String> coerceToStringValues(Map<String, Object> input) {
@@ -159,15 +163,22 @@ private Map<String, String> coerceToStringValues(Map<String, Object> input) {
159163
if (value instanceof Provider<?> provider) {
160164
value = provider.getOrNull();
161165
}
162-
output.put(key, (value != null) ? value.toString() : null);
166+
if (value != null) {
167+
output.put(key, value.toString());
168+
}
163169
});
164170
return output;
165171
}
166172

167173
private Map<String, Object> applyExclusions(Map<String, Object> input) {
168174
Map<String, Object> output = new HashMap<>();
169175
Set<String> exclusions = this.excludes.getOrElse(Collections.emptySet());
170-
input.forEach((key, value) -> output.put(key, (!exclusions.contains(key)) ? value : null));
176+
input.forEach((key, value) -> {
177+
boolean isExcluded = exclusions.contains(key);
178+
if (!isExcluded) {
179+
output.put(key, value);
180+
}
181+
});
171182
return output;
172183
}
173184

0 commit comments

Comments
 (0)