List of usage examples for org.springframework.boot.loader.tools JarWriter JarWriter
public JarWriter(File file, LaunchScript launchScript) throws FileNotFoundException, IOException
From source file:org.springframework.boot.loader.tools.Repackager.java
private void repackage(JarFile sourceJar, File destination, Libraries libraries, LaunchScript launchScript) throws IOException { WritableLibraries writeableLibraries = new WritableLibraries(libraries); try (JarWriter writer = new JarWriter(destination, launchScript)) { writer.writeManifest(buildManifest(sourceJar)); writeLoaderClasses(writer);//from w w w .ja v a 2 s .c o m if (this.layout instanceof RepackagingLayout) { writer.writeEntries(sourceJar, new RenamingEntryTransformer( ((RepackagingLayout) this.layout).getRepackagedClassesLocation()), writeableLibraries); } else { writer.writeEntries(sourceJar, writeableLibraries); } writeableLibraries.write(writer); } }