Libraries (OrderEnumerator orderEnumerator, boolean collectFiles) { Set<String> allMavenCoords = new HashSet<>(); Map<String, String> jarLibrariesIndex = new HashMap<>(); orderEnumerator.recursively() .forEachLibrary(library -> { MavenCoordinates coordinates = getMavenCoordinates(library); if (coordinates != null) { allMavenCoords.add(coordinates.getGroupId() + ":" + coordinates.getArtifactId()); } if (collectFiles && library instanceof LibraryEx) { LibraryProperties<?> libraryProperties = ((LibraryEx)library).getProperties(); if (libraryProperties == null || libraryProperties instanceof RepositoryLibraryProperties) { collectFiles(library, coordinates, jarLibrariesIndex); } } return true; }); return new Libraries(Set.copyOf(allMavenCoords), Map.copyOf(jarLibrariesIndex)); }