Skip to content

Commit df35d44

Browse files
committed
Polish "Remove deprecated getFiles() instead of getResolvedArtifacts()"
See gh-43191
1 parent 659b30d commit df35d44

File tree

1 file changed

+6
-8
lines changed
  • buildSrc/src/main/java/org/springframework/boot/build/bom

1 file changed

+6
-8
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/CheckBom.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,15 @@ private void checkDependencyManagementAlignment(Library library, List<String> er
211211

212212
private File resolveBom(Library library, String alignsWithBom) {
213213
String coordinates = alignsWithBom + ":" + library.getVersion().getVersion() + "@pom";
214-
215214
Set<ResolvedArtifact> artifacts = this.configurations
216-
.detachedConfiguration(this.dependencies.create(coordinates))
217-
.getResolvedConfiguration()
218-
.getResolvedArtifacts();
219-
215+
.detachedConfiguration(this.dependencies.create(coordinates))
216+
.getResolvedConfiguration()
217+
.getResolvedArtifacts();
220218
if (artifacts.size() != 1) {
221-
throw new IllegalStateException(
222-
"Expected a single file but '" + coordinates + "' resolved to " + artifacts.size());
219+
throw new IllegalStateException("Expected a single file but '%s' resolved to %d artifacts"
220+
.formatted(coordinates, artifacts.size()));
223221
}
224-
225222
return artifacts.iterator().next().getFile();
226223
}
224+
227225
}

0 commit comments

Comments
 (0)