Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Build Pull Request
name: Build Pull Request 🏭️
on: pull_request
permissions:
contents: read
jobs:
build:
name: Build Pull Request
name: Build 🏗
if: ${{ github.repository == 'spring-projects/spring-boot' }}
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Build
- name: Build 📦
id: build
uses: ./.github/actions/build
- name: Print JVM Thread Dumps When Cancelled
- name: Log Potentially Cancelled JVM Thread Dumps 📋
if: cancelled()
uses: ./.github/actions/print-jvm-thread-dumps
- name: Upload Build Reports
- name: Upload Build Report 📊
if: failure()
uses: actions/upload-artifact@v5
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ permissions:
contents: read
jobs:
distribute-spring-enterprise-release-bundle:
name: Distribute Release Bundle 📦
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Create Bundle
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: "Run CodeQL Analysis"
name: Run CodeQL Analysis 📊
on:
push:
pull_request:
workflow_dispatch:
permissions: read-all
jobs:
run-analysis:
name: Inspect 🔎
permissions:
actions: read
contents: read
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Sanity Check 🕊️
on:
push:
pull_request:
workflow_dispatch:
permissions: read-all
jobs:
verify:
name: Verify 📊
if: ${{ github.repository == 'spring-projects/spring-boot' }}
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
steps:
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Build 📦
id: build
uses: ./.github/actions/build
- name: Rewrite ♻️
run: ./gradlew rewriteDryRun
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

plugins {
id "base"
id "org.openrewrite.rewrite" version "7.22.0" apply false
}

description = "Spring Boot Build"
Expand Down Expand Up @@ -46,3 +47,5 @@ subprojects {
resolutionStrategy.cacheChangingModulesFor 0, "minutes"
}
}

apply from: rootProject.file("${rootDir}/gradle/plugins/config/sanity.gradle")
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ public void apply(Project project) {
project.afterEvaluate((evaluated) -> project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> {
if (((Jar) project.getTasks().getByName(JavaPlugin.JAR_TASK_NAME)).isEnabled()) {
project.getComponents()
.matching((component) -> component.getName().equals("java"))
.matching((component) -> "java".equals(component.getName()))
.all(mavenPublication::from);
}
}));
project.getPlugins()
.withType(JavaPlatformPlugin.class)
.all((javaPlugin) -> project.getComponents()
.matching((component) -> component.getName().equals("javaPlatform"))
.matching((component) -> "javaPlatform".equals(component.getName()))
.all(mavenPublication::from));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public void apply(Project project) {
mavenRepository.setUrl(repositoryLocation.toURI());
});
project.getTasks()
.matching((task) -> task.getName().equals(PUBLISH_TO_PROJECT_REPOSITORY_TASK_NAME))
.matching((task) -> PUBLISH_TO_PROJECT_REPOSITORY_TASK_NAME.equals(task.getName()))
.all((task) -> setUpProjectRepository(project, task, repositoryLocation));
project.getTasks()
.matching((task) -> task.getName().equals("publishPluginMavenPublicationToProjectRepository"))
.matching((task) -> "publishPluginMavenPublicationToProjectRepository".equals(task.getName()))
.all((task) -> setUpProjectRepository(project, task, repositoryLocation));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ private WellKnownAnchor(Origin origin) {
}

private static WellKnownAnchor of(String anchor, Origin origin) {
if (anchor.equals("enum-constant-summary")) {
if ("enum-constant-summary".equals(anchor)) {
return new WellKnownAnchor(origin);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private JavaClass[] getImportedClasses(JavaClass javaClass) {

private boolean isBootClass(JavaClass javaClass) {
String pkg = javaClass.getPackage().getName();
return pkg.equals(SPRING_BOOT_ROOT_PACKAGE) || pkg.startsWith(SPRING_BOOT_ROOT_PACKAGE + ".");
return SPRING_BOOT_ROOT_PACKAGE.equals(pkg) || pkg.startsWith(SPRING_BOOT_ROOT_PACKAGE + ".");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public List<LibraryWithVersionOptions> findLibraryUpdates(Collection<Library> li
}

protected boolean isLibraryExcluded(Library library) {
return library.getName().equals("Spring Boot");
return "Spring Boot".equals(library.getName());
}

protected List<VersionOption> getVersionOptions(Library library) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private boolean prohibited(ModuleVersionIdentifier id) {
}

private boolean prohibitedSlf4j(ModuleVersionIdentifier id) {
return id.getGroup().equals("org.slf4j") && id.getName().equals("jcl-over-slf4j");
return "org.slf4j".equals(id.getGroup()) && "jcl-over-slf4j".equals(id.getName());
}

private boolean prohibitedJbossSpec(ModuleVersionIdentifier id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private Starter(String name, String description, Set<String> dependencies) {
}

private boolean isProduction() {
return this.name.equals("spring-boot-starter-actuator");
return "spring-boot-starter-actuator".equals(this.name);
}

private boolean isTechnical() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void setup(@TempDir File projectDir) throws IOException {
}

@Test
void jarIncludesLegalFiles() throws IOException {
void jarIncludesLegalFiles() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'java'");
Expand Down Expand Up @@ -101,7 +101,7 @@ void jarIncludesLegalFiles() throws IOException {
}

@Test
void sourceJarIsBuilt() throws IOException {
void sourceJarIsBuilt() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'java'");
Expand Down Expand Up @@ -132,7 +132,7 @@ void sourceJarIsBuilt() throws IOException {
}

@Test
void javadocJarIsBuilt() throws IOException {
void javadocJarIsBuilt() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'java'");
Expand Down Expand Up @@ -176,7 +176,7 @@ private void assertThatNoticeIsPresent(JarFile jar) throws IOException {
}

@Test
void testRetryIsConfiguredWithThreeRetriesOnCI() throws IOException {
void retryIsConfiguredWithThreeRetriesOnCI() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'java'");
Expand All @@ -198,7 +198,7 @@ void testRetryIsConfiguredWithThreeRetriesOnCI() throws IOException {
}

@Test
void testRetryIsConfiguredWithZeroRetriesLocally() throws IOException {
void retryIsConfiguredWithZeroRetriesLocally() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'java'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DocumentAutoConfigurationClassesTests {
private File temp;

@Test
void classesAreDocumented() throws IOException {
void classesAreDocumented() throws Exception {
File output = documentAutoConfigurationClasses((metadataDir) -> {
writeAutoConfigurationMetadata("spring-boot-one", List.of("org.springframework.boot.one.AAutoConfiguration",
"org.springframework.boot.one.BAutoConfiguration"), metadataDir);
Expand All @@ -56,7 +56,7 @@ void classesAreDocumented() throws IOException {
}

@Test
void whenMetadataIsRemovedThenOutputForThatMetadataIsNoLongerPresent() throws IOException {
void whenMetadataIsRemovedThenOutputForThatMetadataIsNoLongerPresent() throws Exception {
documentAutoConfigurationClasses((metadataDir) -> {
writeAutoConfigurationMetadata("spring-boot-one", List.of("org.springframework.boot.one.AAutoConfiguration",
"org.springframework.boot.one.BAutoConfiguration"), metadataDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.function.Consumer;

Expand Down Expand Up @@ -51,7 +50,7 @@ void setup(@TempDir File projectDir) {
}

@Test
void libraryModulesAreIncludedInDependencyManagementOfGeneratedPom() throws IOException {
void libraryModulesAreIncludedInDependencyManagementOfGeneratedPom() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'org.springframework.boot.bom'");
Expand Down Expand Up @@ -88,7 +87,7 @@ void libraryModulesAreIncludedInDependencyManagementOfGeneratedPom() throws IOEx
}

@Test
void libraryPluginsAreIncludedInPluginManagementOfGeneratedPom() throws IOException {
void libraryPluginsAreIncludedInPluginManagementOfGeneratedPom() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'org.springframework.boot.bom'");
Expand Down Expand Up @@ -143,7 +142,7 @@ void libraryImportsAreIncludedInDependencyManagementOfGeneratedPom() throws Exce
}

@Test
void moduleExclusionsAreIncludedInDependencyManagementOfGeneratedPom() throws IOException {
void moduleExclusionsAreIncludedInDependencyManagementOfGeneratedPom() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'org.springframework.boot.bom'");
Expand Down Expand Up @@ -177,7 +176,7 @@ void moduleExclusionsAreIncludedInDependencyManagementOfGeneratedPom() throws IO
}

@Test
void moduleTypesAreIncludedInDependencyManagementOfGeneratedPom() throws IOException {
void moduleTypesAreIncludedInDependencyManagementOfGeneratedPom() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'org.springframework.boot.bom'");
Expand Down Expand Up @@ -209,7 +208,7 @@ void moduleTypesAreIncludedInDependencyManagementOfGeneratedPom() throws IOExcep
}

@Test
void moduleClassifiersAreIncludedInDependencyManagementOfGeneratedPom() throws IOException {
void moduleClassifiersAreIncludedInDependencyManagementOfGeneratedPom() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'org.springframework.boot.bom'");
Expand Down Expand Up @@ -268,7 +267,7 @@ void moduleClassifiersAreIncludedInDependencyManagementOfGeneratedPom() throws I
}

@Test
void libraryNamedSpringBootHasNoVersionProperty() throws IOException {
void libraryNamedSpringBootHasNoVersionProperty() throws Exception {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {");
out.println(" id 'org.springframework.boot.bom'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.Collections;
Expand Down Expand Up @@ -46,7 +45,7 @@ class UpgradeApplicatorTests {
File temp;

@Test
void whenUpgradeIsAppliedToLibraryWithVersionThenBomIsUpdated() throws IOException {
void whenUpgradeIsAppliedToLibraryWithVersionThenBomIsUpdated() throws Exception {
File bom = new File(this.temp, "bom.gradle");
FileCopyUtils.copy(new File("src/test/resources/bom.gradle"), bom);
String originalContents = Files.readString(bom.toPath());
Expand All @@ -61,7 +60,7 @@ void whenUpgradeIsAppliedToLibraryWithVersionThenBomIsUpdated() throws IOExcepti
}

@Test
void whenUpgradeIsAppliedToLibraryWithVersionPropertyThenGradlePropertiesIsUpdated() throws IOException {
void whenUpgradeIsAppliedToLibraryWithVersionPropertyThenGradlePropertiesIsUpdated() throws Exception {
File bom = new File(this.temp, "bom.gradle");
FileCopyUtils.copy(new File("src/test/resources/bom.gradle"), bom);
File gradleProperties = new File(this.temp, "gradle.properties");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void createAnalyzerWithNoSource() {
}

@Test
void analyzeSortWithAlphabeticalOrder(@TempDir File tempDir) throws IOException {
void analyzeSortWithAlphabeticalOrder(@TempDir File tempDir) throws Exception {
File metadata = new File(tempDir, "metadata.json");
Files.writeString(metadata.toPath(), """
{ "properties": [
Expand All @@ -62,7 +62,7 @@ void analyzeSortWithAlphabeticalOrder(@TempDir File tempDir) throws IOException
}

@Test
void analyzeSortWithViolations(@TempDir File tempDir) throws IOException {
void analyzeSortWithViolations(@TempDir File tempDir) throws Exception {
File metadata = new File(tempDir, "metadata.json");
Files.writeString(metadata.toPath(), """
{ "properties": [
Expand All @@ -80,7 +80,7 @@ void analyzeSortWithViolations(@TempDir File tempDir) throws IOException {
}

@Test
void analyzePropertyDescription(@TempDir File tempDir) throws IOException {
void analyzePropertyDescription(@TempDir File tempDir) throws Exception {
File metadata = new File(tempDir, "metadata.json");
Files.writeString(metadata.toPath(), """
{ "properties": [
Expand All @@ -98,7 +98,7 @@ void analyzePropertyDescription(@TempDir File tempDir) throws IOException {
}

@Test
void analyzePropertyDescriptionWithMissingDescription(@TempDir File tempDir) throws IOException {
void analyzePropertyDescriptionWithMissingDescription(@TempDir File tempDir) throws Exception {
File metadata = new File(tempDir, "metadata.json");
Files.writeString(metadata.toPath(), """
{ "properties": [
Expand All @@ -116,7 +116,7 @@ void analyzePropertyDescriptionWithMissingDescription(@TempDir File tempDir) thr
}

@Test
void analyzeDeprecatedPropertyWithMissingSince(@TempDir File tempDir) throws IOException {
void analyzeDeprecatedPropertyWithMissingSince(@TempDir File tempDir) throws Exception {
File metadata = new File(tempDir, "metadata.json");
Files.writeString(metadata.toPath(), """
{ "properties": [
Expand All @@ -142,12 +142,12 @@ void analyzeDeprecatedPropertyWithMissingSince(@TempDir File tempDir) throws IOE
}

@Test
void writeEmptyReport(@TempDir File tempDir) throws IOException {
void writeEmptyReport(@TempDir File tempDir) throws Exception {
assertThat(writeToFile(tempDir, new Report(tempDir))).hasContent("No problems found.");
}

@Test
void writeReportWithNoProblemsFound(@TempDir File tempDir) throws IOException {
void writeReportWithNoProblemsFound(@TempDir File tempDir) throws Exception {
Report report = new Report(tempDir);
File first = new File(tempDir, "metadata-1.json");
report.registerAnalysis(first, new Analysis("Check for things:"));
Expand All @@ -163,7 +163,7 @@ void writeReportWithNoProblemsFound(@TempDir File tempDir) throws IOException {
}

@Test
void writeReportWithOneProblem(@TempDir File tempDir) throws IOException {
void writeReportWithOneProblem(@TempDir File tempDir) throws Exception {
Report report = new Report(tempDir);
File metadata = new File(tempDir, "metadata-1.json");
Analysis analysis = new Analysis("Check for things:");
Expand All @@ -181,7 +181,7 @@ void writeReportWithOneProblem(@TempDir File tempDir) throws IOException {
}

@Test
void writeReportWithSeveralProblems(@TempDir File tempDir) throws IOException {
void writeReportWithSeveralProblems(@TempDir File tempDir) throws Exception {
Report report = new Report(tempDir);
File metadata = new File(tempDir, "metadata-1.json");
Analysis firstAnalysis = new Analysis("Check for things:");
Expand Down
Loading
Loading