Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into draft-interface-clien…
Browse files Browse the repository at this point in the history
…ts-autoconfiguration
  • Loading branch information
OlgaMaciaszek committed Sep 19, 2024
2 parents 3699930 + e950801 commit 6f72aaf
Show file tree
Hide file tree
Showing 486 changed files with 7,376 additions and 2,502 deletions.
5 changes: 5 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
required: false
default: 'false'
description: 'Whether a Java toolchain should be used'
java-distribution:
required: false
default: 'liberica'
description: 'The distribution of Java to use'
publish:
required: false
default: 'false'
Expand All @@ -37,6 +41,7 @@ runs:
java-version: ${{ inputs.java-version }}
java-early-access: ${{ inputs.java-early-access }}
java-toolchain: ${{ inputs.java-toolchain }}
java-distribution: ${{ inputs.java-distribution }}
- name: Build
id: build
if: ${{ inputs.publish == 'false' }}
Expand Down
10 changes: 7 additions & 3 deletions .github/actions/prepare-gradle-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ inputs:
java-early-access:
required: false
default: 'false'
description: 'Whether the Java version is in early access'
description: 'Whether the Java version is in early access. When true, forces java-distribution to temurin'
java-toolchain:
required: false
default: 'false'
description: 'Whether a Java toolchain should be used'
java-distribution:
required: false
default: 'liberica'
description: 'The distribution of Java to use'
develocity-access-key:
required: false
description: 'The access key for authentication with ge.spring.io'
Expand All @@ -27,12 +31,12 @@ runs:
- name: Set Up Java
uses: actions/setup-java@v4
with:
distribution: ${{ inputs.java-early-access == 'true' && 'temurin' || 'liberica' }}
distribution: ${{ inputs.java-early-access == 'true' && 'temurin' || (inputs.java-distribution || 'liberica') }}
java-version: |
${{ inputs.java-early-access == 'true' && format('{0}-ea', inputs.java-version) || inputs.java-version }}
${{ inputs.java-toolchain == 'true' && '17' || '' }}
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
with:
cache-read-only: false
develocity-access-key: ${{ inputs.develocity-access-key }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/publish-gradle-plugin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
using: composite
steps:
- name: Set Up JFrog CLI
uses: jfrog/setup-jfrog-cli@26532cdb5b1ea07940f10d57666fd988048fc903 # v4.2.2
uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
env:
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
- name: Download Artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/sync-to-maven-central/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
using: composite
steps:
- name: Set Up JFrog CLI
uses: jfrog/setup-jfrog-cli@26532cdb5b1ea07940f10d57666fd988048fc903 # v4.2.2
uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
env:
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
- name: Download Release Artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency:
jobs:
build-and-deploy-snapshot:
name: Build and Deploy Snapshot
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
if: ${{ github.repository == 'spring-projects/spring-boot' }}
steps:
- name: Check Out Code
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
version: ${{ steps.build-and-publish.outputs.version }}
trigger-docs-build:
name: Trigger Docs Build
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
needs: build-and-deploy-snapshot
permissions:
actions: write
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
jobs:
build:
name: Build Pull Request
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
if: ${{ github.repository == 'spring-projects/spring-boot' }}
steps:
- name: Free Disk Space
Expand All @@ -23,9 +23,9 @@ jobs:
- name: Check Out
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
uses: gradle/actions/wrapper-validation@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- name: Build
env:
CI: 'true'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os:
- id: ubuntu-latest
- id: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
name: Linux
- id: windows-latest
name: Windows
Expand All @@ -26,8 +26,7 @@ jobs:
- version: 22
toolchain: false
- version: 23
early-access: true
toolchain: false
toolchain: true
exclude:
- os:
name: Linux
Expand All @@ -49,6 +48,7 @@ jobs:
java-version: ${{ matrix.java.version }}
java-early-access: ${{ matrix.java.early-access || 'false' }}
java-toolchain: ${{ matrix.java.toolchain }}
java-distribution: ${{ matrix.java.distribution }}
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
- name: Send Notification
uses: ./.github/actions/send-notification
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
jobs:
build-and-stage-release:
name: Build and Stage Release
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_MEDIUIM || 'ubuntu-latest' }}
if: ${{ github.repository == 'spring-projects/spring-boot' }}
steps:
- name: Check Out Code
Expand Down Expand Up @@ -50,10 +50,10 @@ jobs:
needs:
- build-and-stage-release
- verify
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Set up JFrog CLI
uses: jfrog/setup-jfrog-cli@26532cdb5b1ea07940f10d57666fd988048fc903 # v4.2.2
uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Promote build
Expand All @@ -63,7 +63,7 @@ jobs:
needs:
- build-and-stage-release
- promote-release
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency:
jobs:
build-and-stage-release:
name: Build and Stage Release
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_MEDIUIM || 'ubuntu-latest' }}
if: ${{ github.repository == 'spring-projects/spring-boot' }}
steps:
- name: Check Out Code
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
needs:
- build-and-stage-release
- verify
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -66,10 +66,10 @@ jobs:
needs:
- build-and-stage-release
- sync-to-maven-central
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Set up JFrog CLI
uses: jfrog/setup-jfrog-cli@26532cdb5b1ea07940f10d57666fd988048fc903 # v4.2.2
uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Promote build
Expand All @@ -79,7 +79,7 @@ jobs:
needs:
- build-and-stage-release
- sync-to-maven-central
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -95,7 +95,7 @@ jobs:
needs:
- build-and-stage-release
- sync-to-maven-central
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -111,7 +111,7 @@ jobs:
needs:
- build-and-stage-release
- sync-to-maven-central
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -128,7 +128,7 @@ jobs:
- publish-gradle-plugin
- publish-to-sdkman
- update-homebrew-tap
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency:
jobs:
run-system-tests:
name: 'Java ${{ matrix.java.version}}'
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
if: ${{ github.repository == 'spring-projects/spring-boot' }}
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger-docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
jobs:
trigger-docs-build:
name: Trigger Docs Build
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
if: github.repository_owner == 'spring-projects'
steps:
- name: Check Out
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
verify:
name: Verify
runs-on: ubuntu-latest
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Release Verification Tests
uses: actions/checkout@v4
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Set Up Homebrew
uses: Homebrew/actions/setup-homebrew@7657c9512f50e1c35b640971116425935bab3eea
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
with:
cache-read-only: false
- name: Configure Gradle Properties
Expand Down
1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ The https://spring.io/[spring.io] site contains several guides that show how to

* https://spring.io/guides/gs/spring-boot/[Building an Application with Spring Boot] is an introductory guide that shows you how to create an application, run it, and add some management services.
* https://spring.io/guides/gs/actuator-service/[Building a RESTful Web Service with Spring Boot Actuator] is a guide to creating a REST web service and also shows how the server can be configured.
* https://spring.io/guides/gs/convert-jar-to-war/[Converting a Spring Boot JAR Application to a WAR] shows you how to run applications in a web server as a WAR file.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.gradle.api.Project;
import org.gradle.api.logging.LogLevel;
import org.gradle.api.plugins.JavaBasePlugin;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Copy;
import org.gradle.api.tasks.TaskContainer;

Expand Down Expand Up @@ -118,8 +119,7 @@ private void configureGenerateAntoraYmlTask(Project project, GenerateAntoraYmlTa
generateAntoraYmlTask.setProperty("outputFile",
new File(project.getBuildDir(), "generated/docs/antora-yml/antora.yml"));
generateAntoraYmlTask.setProperty("yml", getDefaultYml(project));
generateAntoraYmlTask.doFirst((task) -> generateAntoraYmlTask.getAsciidocAttributes()
.putAll(project.provider(() -> getAsciidocAttributes(project, dependencyVersionsTask))));
generateAntoraYmlTask.getAsciidocAttributes().putAll(getAsciidocAttributes(project, dependencyVersionsTask));
}

private Map<String, ?> getDefaultYml(Project project) {
Expand All @@ -138,12 +138,14 @@ private void configureGenerateAntoraYmlTask(Project project, GenerateAntoraYmlTa
return defaultYml;
}

private Map<String, String> getAsciidocAttributes(Project project,
private Provider<Map<String, String>> getAsciidocAttributes(Project project,
ExtractVersionConstraints dependencyVersionsTask) {
BomExtension bom = (BomExtension) project.project(DEPENDENCIES_PATH).getExtensions().getByName("bom");
Map<String, String> dependencyVersions = dependencyVersionsTask.getVersionConstraints();
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes(project, bom, dependencyVersions);
return attributes.get();
return project.provider(() -> {
BomExtension bom = (BomExtension) project.project(DEPENDENCIES_PATH).getExtensions().getByName("bom");
Map<String, String> dependencyVersions = dependencyVersionsTask.getVersionConstraints();
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes(project, bom, dependencyVersions);
return attributes.get();
});
}

private void configureAntoraTask(Project project, AntoraTask antoraTask, NpmInstallTask npmInstallTask,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@

package org.springframework.boot.build;

import javax.inject.Inject;

import org.gradle.api.DefaultTask;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.FileSystemOperations;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputDirectory;
Expand All @@ -32,8 +35,12 @@
*/
public abstract class SyncAppSource extends DefaultTask {

public SyncAppSource() {
private final FileSystemOperations fileSystemOperations;

@Inject
public SyncAppSource(FileSystemOperations fileSystemOperations) {
getPluginVersion().convention(getProject().provider(() -> getProject().getVersion().toString()));
this.fileSystemOperations = fileSystemOperations;
}

@InputDirectory
Expand All @@ -47,11 +54,11 @@ public SyncAppSource() {

@TaskAction
void syncAppSources() {
getProject().sync((copySpec) -> {
this.fileSystemOperations.sync((copySpec) -> {
copySpec.from(getSourceDirectory());
copySpec.into(getDestinationDirectory());
copySpec.filter((line) -> line.replace("id \"org.springframework.boot\"",
"id \"org.springframework.boot\" version \"" + getProject().getVersion() + "\""));
"id \"org.springframework.boot\" version \"" + getPluginVersion().get() + "\""));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.stream.Collectors;

import org.gradle.api.Project;

Expand Down Expand Up @@ -130,13 +132,21 @@ private void addSpringDataDependencyVersion(Map<String, String> attributes, Stri
}

private void addSpringDataDependencyVersion(Map<String, String> attributes, String name, String artifactId) {
addDependencyVersion(attributes, name, "org.springframework.data:" + artifactId);
String version = getVersion("org.springframework.data:" + artifactId);
String majorMinor = Arrays.stream(version.split("\\.")).limit(2).collect(Collectors.joining("."));
String antoraVersion = version.endsWith(DASH_SNAPSHOT) ? majorMinor + DASH_SNAPSHOT : majorMinor;
attributes.put("version-" + name + "-docs", antoraVersion);
attributes.put("version-" + name + "-javadoc", majorMinor + ".x");
}

private void addDependencyVersion(Map<String, String> attributes, String name, String groupAndArtifactId) {
attributes.put("version-" + name, getVersion(groupAndArtifactId));
}

private String getVersion(String groupAndArtifactId) {
String version = this.dependencyVersions.get(groupAndArtifactId);
Assert.notNull(version, () -> "No version found for " + groupAndArtifactId);
attributes.put("version-" + name, version);
return version;
}

private void addArtifactAttributes(Map<String, String> attributes) {
Expand Down
Loading

0 comments on commit 6f72aaf

Please sign in to comment.