Skip bootstrap.yml merge when spring-cloud-starter-bootstrap is present#954
Merged
Jenson3210 merged 6 commits intomainfrom Mar 5, 2026
Merged
Skip bootstrap.yml merge when spring-cloud-starter-bootstrap is present#954Jenson3210 merged 6 commits intomainfrom
Jenson3210 merged 6 commits intomainfrom
Conversation
In Spring Boot 2.4, the bootstrap context is disabled by default but continues to work if spring-cloud-starter-bootstrap is on the classpath. The MergeBootstrapYamlWithApplicationYaml recipe now checks for this dependency in both Maven and Gradle projects and skips the merge when it is present, avoiding incorrect migration of projects that still rely on the bootstrap context. Fixes moderneinc/customer-requests#1951
timtebeek
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MergeBootstrapYamlWithApplicationYamlwhenspring-cloud-starter-bootstrapis a project dependencyMavenResolutionResult) and Gradle (GradleProject) markers for the dependencyProblem
The
MergeBootstrapYamlWithApplicationYamlrecipe unconditionally mergesbootstrap.ymlintoapplication.yml. However, in Spring Boot 2.4 the bootstrap context was only disabled by default — projects that includespring-cloud-starter-bootstrapas a dependency still load bootstrap files normally and should not have them merged away.See the Spring Cloud Config Client docs — to use the legacy bootstrap way of connecting to Config Server, bootstrap must be enabled via the
spring-cloud-starter-bootstrapstarter.Solution
During the scan phase, check each source file's build tool markers for
org.springframework.cloud:spring-cloud-starter-bootstrap. If found, the recipe skips entirely — no merging, no file generation, no file deletion.Test plan
doNotMergeWhenSpringCloudStarterBootstrapPresentaddedFixes moderneinc/customer-requests#1951