类 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'.
- 从以下版本开始:
- 1.0.0
- 作者:
- Phillip Webb, Andy Wilkinson, Stephane Nicoll, Madhura Bhave, Scott Frederick
-
嵌套类概要
从类继承的嵌套类/接口 org.springframework.boot.loader.tools.Packager
Packager.MainClassTimeoutWarningListener
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
Repackage to the given destination so that it can be launched using ' java -jar'.void
repackage
(File destination, Libraries libraries, LaunchScript launchScript) Repackage to the given destination so that it can be launched using ' java -jar'.void
repackage
(File destination, Libraries libraries, LaunchScript launchScript, FileTime lastModifiedTime) Repackage to the given destination so that it can be launched using ' java -jar'.void
Repackage the source file so that it can be run using 'java -jar'.void
setBackupSource
(boolean backupSource) Sets if source files should be backed up when they would be overwritten.protected void
writeSignatureFileIfNecessary
(Map<String, Library> writtenLibraries, AbstractJarWriter writer) Writes a signature file if necessary for the givenwrittenLibraries
.从类继承的方法 org.springframework.boot.loader.tools.Packager
addMainClassTimeoutWarningListener, findMainMethod, getBackupFile, getLayout, getSource, isAlreadyPackaged, isAlreadyPackaged, setBackupFile, setIncludeRelevantJarModeJars, setLayers, setLayout, setLayoutFactory, setLoaderImplementation, setMainClass, write, write
-
构造器详细资料
-
Repackager
Create a newRepackager
instance.- 参数:
source
- the source archive file to package
-
-
方法详细资料
-
writeSignatureFileIfNecessary
protected void writeSignatureFileIfNecessary(Map<String, Library> writtenLibraries, AbstractJarWriter writer) throws IOException从类复制的说明:Packager
Writes a signature file if necessary for the givenwrittenLibraries
.- 覆盖:
writeSignatureFileIfNecessary
在类中Packager
- 参数:
writtenLibraries
- the librarieswriter
- the writer to use to write the signature file if necessary- 抛出:
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.- 参数:
backupSource
- if source files should be backed up
-
repackage
Repackage the source file so that it can be run using 'java -jar'.- 参数:
libraries
- the libraries required to run the archive- 抛出:
IOException
- if the file cannot be repackaged
-
repackage
Repackage to the given destination so that it can be launched using ' java -jar'.- 参数:
destination
- the destination file (may be the same as the source)libraries
- the libraries required to run the archive- 抛出:
IOException
- if the file cannot be repackaged
-
repackage
public void repackage(File destination, Libraries libraries, LaunchScript launchScript) throws IOException Repackage to the given destination so that it can be launched using ' java -jar'.- 参数:
destination
- the destination file (may be the same as the source)libraries
- the libraries required to run the archivelaunchScript
- an optional launch script prepended to the front of the jar- 抛出:
IOException
- if the file cannot be repackaged- 从以下版本开始:
- 1.3.0
-
repackage
public void repackage(File destination, Libraries libraries, LaunchScript launchScript, FileTime lastModifiedTime) throws IOException Repackage to the given destination so that it can be launched using ' java -jar'.- 参数:
destination
- the destination file (may be the same as the source)libraries
- the libraries required to run the archivelaunchScript
- an optional launch script prepended to the front of the jarlastModifiedTime
- an optional last modified time to apply to the archive and its contents- 抛出:
IOException
- if the file cannot be repackaged- 从以下版本开始:
- 2.3.0
-