See gh-19995
This commit is contained in:
Johnny Lim
2020-02-01 00:00:26 +09:00
committed by Stephane Nicoll
parent afb67887da
commit e6d5f5a271
7 changed files with 13 additions and 29 deletions

View File

@@ -69,7 +69,7 @@ public class BootJar extends Jar implements BootArchive {
private static final String BOOT_INF_LAYERS = "BOOT-INF/layers";
private List<String> dependencies = new ArrayList<>();
private final List<String> dependencies = new ArrayList<>();
/**
* Creates a new {@code BootJar} task.
@@ -111,22 +111,11 @@ public class BootJar extends Jar implements BootArchive {
}
private File createClasspathIndex(List<String> dependencies) {
try {
StringWriter content = new StringWriter();
BufferedWriter writer = new BufferedWriter(content);
for (String dependency : dependencies) {
writer.write(dependency);
writer.write("\n");
}
writer.flush();
File source = getProject().getResources().getText().fromString(content.toString()).asFile();
File indexFile = new File(source.getParentFile(), "classpath.idx");
source.renameTo(indexFile);
return indexFile;
}
catch (IOException ex) {
throw new RuntimeException("Failed to create classpath.idx", ex);
}
String content = dependencies.stream().collect(Collectors.joining("\n", "", "\n"));
File source = getProject().getResources().getText().fromString(content).asFile();
File indexFile = new File(source.getParentFile(), "classpath.idx");
source.renameTo(indexFile);
return indexFile;
}
@Override

View File

@@ -411,11 +411,6 @@ abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
this.libPath + "third-library.jar");
}
@Test
void libEntriesAreStored() throws IOException {
}
protected File jarFile(String name) throws IOException {
File file = newFile(name);
try (JarOutputStream jar = new JarOutputStream(new FileOutputStream(file))) {