Omit libraries with null destination when repackaging

Closes gh-12437
This commit is contained in:
Andy Wilkinson
2018-03-12 13:31:16 +00:00
parent 7f9ab8078f
commit 6d16c5ff6e
2 changed files with 25 additions and 7 deletions

View File

@@ -423,13 +423,14 @@ public class Repackager {
libraries.doWithLibraries((library) -> {
if (isZip(library.getFile())) {
String libraryDestination = Repackager.this.layout
.getLibraryDestination(library.getName(), library.getScope())
+ library.getName();
Library existing = this.libraryEntryNames
.putIfAbsent(libraryDestination, library);
if (existing != null) {
throw new IllegalStateException(
"Duplicate library " + library.getName());
.getLibraryDestination(library.getName(), library.getScope());
if (libraryDestination != null) {
Library existing = this.libraryEntryNames.putIfAbsent(
libraryDestination + library.getName(), library);
if (existing != null) {
throw new IllegalStateException(
"Duplicate library " + library.getName());
}
}
}
});