Class Repackager
java.lang.Object
org.springframework.boot.loader.tools.Packager
org.springframework.boot.loader.tools.Repackager
Utility class that can be used to repackage an archive so that it can be executed using
'java -jar'.
- Since:
 - 1.0.0
 - Author:
 - Phillip Webb, Andy Wilkinson, Stephane Nicoll, Madhura Bhave, Scott Frederick
 
- 
Nested Class Summary
Nested classes/interfaces inherited from class Packager
Packager.MainClassTimeoutWarningListener - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidRepackage to the given destination so that it can be launched using ' java -jar'.voidRepackage to the given destination so that it can be launched using ' java -jar'.voidRepackage the source file so that it can be run using 'java -jar'.voidsetBackupSource(boolean backupSource) Sets if source files should be backed up when they would be overwritten.protected voidwriteSignatureFileIfNecessary(Map<String, Library> writtenLibraries, AbstractJarWriter writer) Writes a signature file if necessary for the givenwrittenLibraries.Methods inherited from class Packager
addMainClassTimeoutWarningListener, findMainMethod, getBackupFile, getLayout, getSource, isAlreadyPackaged, isAlreadyPackaged, setBackupFile, setIncludeRelevantJarModeJars, setLayers, setLayout, setLayoutFactory, setMainClass, write, write 
- 
Constructor Details
- 
Repackager
Create a newRepackagerinstance.- Parameters:
 source- the source archive file to package
 
 - 
 - 
Method Details
- 
writeSignatureFileIfNecessary
protected void writeSignatureFileIfNecessary(Map<String, Library> writtenLibraries, AbstractJarWriter writer) throws IOExceptionDescription copied from class:PackagerWrites a signature file if necessary for the givenwrittenLibraries.- Overrides:
 writeSignatureFileIfNecessaryin classPackager- Parameters:
 writtenLibraries- the librarieswriter- the writer to use to write the signature file if necessary- Throws:
 IOException- if a failure occurs when writing the signature file
 - 
setBackupSource
public void setBackupSource(boolean backupSource) Sets if source files should be backed up when they would be overwritten.- Parameters:
 backupSource- if source files should be backed up
 - 
repackage
Repackage the source file so that it can be run using 'java -jar'.- Parameters:
 libraries- the libraries required to run the archive- Throws:
 IOException- if the file cannot be repackaged
 - 
repackage
Repackage to the given destination so that it can be launched using ' java -jar'.- Parameters:
 destination- the destination file (may be the same as the source)libraries- the libraries required to run the archive- Throws:
 IOException- if the file cannot be repackaged
 - 
repackage
public void repackage(File destination, Libraries libraries, @Nullable FileTime lastModifiedTime) throws IOException Repackage to the given destination so that it can be launched using ' java -jar'.- Parameters:
 destination- the destination file (may be the same as the source)libraries- the libraries required to run the archivelastModifiedTime- an optional last modified time to apply to the archive and its contents- Throws:
 IOException- if the file cannot be repackaged- Since:
 - 4.0.0
 
 
 -