Merge branch '2.4.x' into 2.5.x

Closes gh-27056
This commit is contained in:
Phillip Webb
2021-06-23 15:55:08 -07:00
18 changed files with 344 additions and 108 deletions

View File

@@ -24,6 +24,7 @@ import org.gradle.api.specs.Spec;
import org.springframework.boot.gradle.tasks.bundling.ResolvedDependencies.DependencyDescriptor;
import org.springframework.boot.loader.tools.Layer;
import org.springframework.boot.loader.tools.Library;
import org.springframework.boot.loader.tools.LibraryCoordinates;
/**
* Resolver backed by a {@link LayeredSpec} that provides the destination {@link Layer}
@@ -77,9 +78,12 @@ class LayerResolver {
private Library asLibrary(FileCopyDetails details) {
File file = details.getFile();
DependencyDescriptor dependency = this.resolvedDependencies.find(file);
return (dependency != null)
? new Library(null, file, null, dependency.getCoordinates(), false, dependency.isProjectDependency())
: new Library(file, null);
if (dependency == null) {
return new Library(null, file, null, null, false, false, true);
}
LibraryCoordinates coordinates = dependency.getCoordinates();
boolean projectDependency = dependency.isProjectDependency();
return new Library(null, file, null, coordinates, false, projectDependency, true);
}
}