Polish
See gh-19995
This commit is contained in:
committed by
Stephane Nicoll
parent
afb67887da
commit
e6d5f5a271
@@ -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
|
||||
|
||||
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user