类 Packager
java.lang.Object
org.springframework.boot.loader.tools.Packager
- 直接已知子类:
ImagePackager,Repackager
Abstract base class for packagers.
- 从以下版本开始:
- 2.3.0
- 作者:
- Phillip Webb, Andy Wilkinson, Stephane Nicoll, Madhura Bhave, Scott Frederick
-
嵌套类概要
嵌套类修饰符和类型类说明static interfaceCallback interface used to present a warning when finding the main class takes too long. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidAdd a listener that will be triggered to display a warning if searching for the main class takes too long.protected StringfindMainMethod(JarFile source) final FileReturn theFileto use to back up the original source.protected final Layoutprotected final Fileprotected final booleanprotected final booleanisAlreadyPackaged(File file) protected voidsetBackupFile(File backupFile) Sets theFileto use to back up the original source.voidsetIncludeRelevantJarModeJars(boolean includeRelevantJarModeJars) Sets if jarmode jars relevant for the packaging should be automatically included.voidSets the layers that should be used in the jar.voidSets the layout to use for the jar.voidsetLayoutFactory(LayoutFactory layoutFactory) Sets the layout factory for the jar.voidsetLoaderImplementation(LoaderImplementation loaderImplementation) Sets the loader implementation to use.voidsetMainClass(String mainClass) Sets the main class that should be run.protected final voidwrite(JarFile sourceJar, Libraries libraries, AbstractJarWriter writer) protected final voidwrite(JarFile sourceJar, Libraries libraries, AbstractJarWriter writer, boolean ensureReproducibleBuild) protected voidwriteSignatureFileIfNecessary(Map<String, Library> writtenLibraries, AbstractJarWriter writer) Writes a signature file if necessary for the givenwrittenLibraries.
-
构造器详细资料
-
Packager
Create a newPackagerinstance.- 参数:
source- the source archive file to package
-
-
方法详细资料
-
addMainClassTimeoutWarningListener
Add a listener that will be triggered to display a warning if searching for the main class takes too long.- 参数:
listener- the listener to add
-
setMainClass
Sets the main class that should be run. If not specified the value from the MANIFEST will be used, or if no manifest entry is found the archive will be searched for a suitable class.- 参数:
mainClass- the main class name
-
setLayout
Sets the layout to use for the jar. Defaults toLayouts.forFile(File).- 参数:
layout- the layout
-
setLoaderImplementation
Sets the loader implementation to use.- 参数:
loaderImplementation- the loaderImplementation to set
-
setLayoutFactory
Sets the layout factory for the jar. The factory can be used when no specific layout is specified.- 参数:
layoutFactory- the layout factory to set
-
setLayers
Sets the layers that should be used in the jar.- 参数:
layers- the jar layers
-
setBackupFile
Sets theFileto use to back up the original source.- 参数:
backupFile- the file to use to back up the original source
-
setIncludeRelevantJarModeJars
public void setIncludeRelevantJarModeJars(boolean includeRelevantJarModeJars) Sets if jarmode jars relevant for the packaging should be automatically included.- 参数:
includeRelevantJarModeJars- if relevant jars are included
-
isAlreadyPackaged
protected final boolean isAlreadyPackaged() -
isAlreadyPackaged
-
write
protected final void write(JarFile sourceJar, Libraries libraries, AbstractJarWriter writer) throws IOException - 抛出:
IOException
-
write
protected final void write(JarFile sourceJar, Libraries libraries, AbstractJarWriter writer, boolean ensureReproducibleBuild) throws IOException - 抛出:
IOException
-
writeSignatureFileIfNecessary
protected void writeSignatureFileIfNecessary(Map<String, Library> writtenLibraries, AbstractJarWriter writer) throws IOExceptionWrites a signature file if necessary for the givenwrittenLibraries.- 参数:
writtenLibraries- the librarieswriter- the writer to use to write the signature file if necessary- 抛出:
IOException- if a failure occurs when writing the signature file
-
findMainMethod
- 抛出:
IOException
-
getBackupFile
Return theFileto use to back up the original source.- 返回:
- the file to use to back up the original source
-
getSource
-
getLayout
-