Skip BOM download when version contains unresolved placeholders#6674
Merged
Jenson3210 merged 2 commits intomainfrom Feb 4, 2026
Merged
Skip BOM download when version contains unresolved placeholders#6674Jenson3210 merged 2 commits intomainfrom
Jenson3210 merged 2 commits intomainfrom
Conversation
Reproduces IllegalArgumentException when RemoveRedundantDependencyVersions
encounters a mavenBom dependency that uses a Gradle variable reference like
${springCloudVersion}. The unresolved placeholder is passed to
MavenPomDownloader.download() which fails in URI.create().
When a mavenBom entry in the Spring dependency-management plugin uses a
Gradle variable (e.g. ${springCloudVersion}), the version is stored as
a literal placeholder string. Passing this to MavenPomDownloader.download()
causes IllegalArgumentException from URI.create() because ${ is not valid
in a URI path.
Skip the download attempt when the version contains unresolved ${}
placeholders, consistent with how the recipe already handles missing
versions.
timtebeek
approved these changes
Feb 4, 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
IllegalArgumentExceptionfromURI.create()when${...}characters appear in the download URLProblem
When a Gradle build uses the Spring dependency-management plugin with a
mavenBomthat references a Gradle variable:dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" } }The
SpringDependencyManagementPluginEntrytrait stores the version as the literal string${springCloudVersion}.RemoveRedundantDependencyVersionsthen passes this unresolved version directly toMavenPomDownloader.download(), which constructs a URL containing${...}causingIllegalArgumentException.Solution
Added a guard to skip the BOM download when the version is null or contains unresolved
${placeholders. Dependencies managed by other BOMs with resolved versions (like Spring Boot) continue to work correctly. Dependencies managed only by the unresolved BOM conservatively keep their explicit versions rather than crashing.Test plan
mavenBomWithUnresolvedVariablereproduces the exactIllegalArgumentExceptionRemoveRedundantDependencyVersionsTesttests pass