Jar files added after build time should be added to classpath
Fixes gh-19973
This commit is contained in:
@@ -72,6 +72,13 @@ final class ClassPathIndexFile {
|
||||
return this.folders.contains(name);
|
||||
}
|
||||
|
||||
boolean containsEntry(String name) {
|
||||
if (name == null || name.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return this.lines.contains(name);
|
||||
}
|
||||
|
||||
List<URL> getUrls() {
|
||||
return Collections.unmodifiableList(this.lines.stream().map(this::asUrl).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@@ -101,17 +101,18 @@ public abstract class ExecutableArchiveLauncher extends Launcher {
|
||||
|
||||
@Override
|
||||
protected Iterator<Archive> getClassPathArchivesIterator() throws Exception {
|
||||
Archive.EntryFilter searchFilter = (entry) -> isSearchCandidate(entry) && !isFolderIndexed(entry);
|
||||
Iterator<Archive> archives = this.archive.getNestedArchives(searchFilter, this::isNestedArchive);
|
||||
Archive.EntryFilter searchFilter = this::isSearchCandidate;
|
||||
Iterator<Archive> archives = this.archive.getNestedArchives(searchFilter,
|
||||
(entry) -> isNestedArchive(entry) && !isEntryIndexed(entry));
|
||||
if (isPostProcessingClassPathArchives()) {
|
||||
archives = applyClassPathArchivePostProcessing(archives);
|
||||
}
|
||||
return archives;
|
||||
}
|
||||
|
||||
private boolean isFolderIndexed(Archive.Entry entry) {
|
||||
private boolean isEntryIndexed(Archive.Entry entry) {
|
||||
if (this.classPathIndex != null) {
|
||||
return this.classPathIndex.containsFolder(entry.getName());
|
||||
return this.classPathIndex.containsEntry(entry.getName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user