Merge branch '1.5.x'

This commit is contained in:
Phillip Webb
2017-12-13 13:07:18 -08:00
14 changed files with 124 additions and 44 deletions

View File

@@ -42,7 +42,7 @@ import org.springframework.boot.loader.tools.LibraryScope;
*/
public class ArtifactsLibraries implements Libraries {
private static final Map<String, LibraryScope> scopes;
private static final Map<String, LibraryScope> SCOPES;
static {
Map<String, LibraryScope> libraryScopes = new HashMap<>();
@@ -50,7 +50,7 @@ public class ArtifactsLibraries implements Libraries {
libraryScopes.put(Artifact.SCOPE_RUNTIME, LibraryScope.RUNTIME);
libraryScopes.put(Artifact.SCOPE_PROVIDED, LibraryScope.PROVIDED);
libraryScopes.put(Artifact.SCOPE_SYSTEM, LibraryScope.PROVIDED);
scopes = Collections.unmodifiableMap(libraryScopes);
SCOPES = Collections.unmodifiableMap(libraryScopes);
}
private final Set<Artifact> artifacts;
@@ -70,7 +70,7 @@ public class ArtifactsLibraries implements Libraries {
public void doWithLibraries(LibraryCallback callback) throws IOException {
Set<String> duplicates = getDuplicates(this.artifacts);
for (Artifact artifact : this.artifacts) {
LibraryScope scope = scopes.get(artifact.getScope());
LibraryScope scope = SCOPES.get(artifact.getScope());
if (scope != null && artifact.getFile() != null) {
String name = getFileName(artifact);
if (duplicates.contains(name)) {