Package rife.bld.extension
Class AbstractBootOperation<T extends AbstractBootOperation<T>>
java.lang.Object
rife.bld.operations.AbstractOperation<AbstractBootOperation<T>>
rife.bld.extension.AbstractBootOperation<T>
- Type Parameters:
T- the type parameter
- Direct Known Subclasses:
BootJarOperation,BootWarOperation
public abstract class AbstractBootOperation<T extends AbstractBootOperation<T>>
extends AbstractOperation<AbstractBootOperation<T>>
Implements common methods used by Spring Boot operations, such as
BootJarOperation and
BootWarOperation.- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the destination directory in which the archive will be created.destinationDirectory(File directory) Provides the destination directory in which the archive will be created.destinationDirectory(String directory) Provides the destination directory in which the archive will be created.destinationDirectory(Path directory) Provides the destination directory in which the archive will be created.Retrieves the file name that will be used for the archive creation.destinationFileName(String name) Provides the file name that will be used for the archive creation.protected voidexecuteCopyBootLoader(File stagingDirectory) Part of theexecuteoperation, copies the Spring Boot loader launcher archive content to the staging directory.protected voidexecuteCopyInfClassesFiles(File stagingInfDirectory) protected voidexecuteCopyInfLibs(File stagingInfDirectory) protected FileexecuteCreateArchive(File stagingDirectory) Part of theexecuteoperation, creates the archive from the staging directory.protected voidexecuteCreateManifest(File stagingDirectory) Part of theexecuteoperation, creates the manifest for the archive.abstract TfromProject(Project project) Configures the operation from aProject.infLibs()Retrieves the libraries inBOOT-INForWEB-INF.Provides the libraries that will be stored inBOOT-INForWEB-INF.Provides the libraries that will be stored inBOOT-INForWEB-INF.Provides the libraries that will be stored inBOOT-INForWEB-INF.final TinfLibs(Collection<File> jars) Provides the libraries that will be stored inBOOT-INForWEB-INF.final TinfLibsPaths(Collection<Path> jars) Provides the libraries that will be stored inBOOT-INForWEB-INF.final TinfLibsStrings(Collection<String> jars) Provides the libraries that will be stored inBOOT-INForWEB-INF.protected StringRetrieves the Spring Boot loader launcher fully qualified class name.launcherClass(String className) Provides the Spring Boot loader launcher fully qualified class name.Retrieves the Spring Boot loader launcher libraries.launcherLibs(File... jars) Provides the libraries for the Spring Boot loader launcher.launcherLibs(String... jars) Provides the libraries for the Spring Boot loader launcher.launcherLibs(Path... jars) Provides the libraries for the Spring Boot loader launcher.final TlauncherLibs(Collection<File> jars) Provides the libraries for the Spring Boot loader launcher.final TlauncherLibsPaths(Collection<Path> jars) Provides the libraries for the Spring Boot loader launcher.final TlauncherLibsStrings(Collection<String> jars) Provides the libraries for the Spring Boot loader launcher.Retrieves the main class name.protected TProvides the fully qualified main class name.manifestAttribute(String name, String value) Provides an attribute to put in the archive manifest.Retrieves the attributes that will be put in the archive manifest.manifestAttributes(Map<String, String> attributes) Provides a map of attributes to put in the archive manifest.Retrieves the source directories that will be used for the archive creation.sourceDirectories(File... directories) Provides source directories that will be used for the archive creation.sourceDirectories(String... directories) Provides source directories that will be used for the archive creation.sourceDirectories(Path... directories) Provides source directories that will be used for the archive creation.final TsourceDirectories(Collection<File> directories) Provides source directories that will be used for the archive creation.final TsourceDirectoriesPaths(Collection<Path> directories) Provides source directories that will be used for the archive creation.final TsourceDirectoriesStrings(Collection<String> directories) Provides source directories that will be used for the archive creation.protected voidVerifies that all the elements (mainClass,launcherClassandlauncherLibs) required to create the archive have been provided, throws anIllegalArgumentExceptionotherwise.Methods inherited from class rife.bld.operations.AbstractOperation
execute, executeOnce, executeOnce, silent, silent
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractBootOperation
public AbstractBootOperation()
-
-
Method Details
-
destinationDirectory
Provides the destination directory in which the archive will be created.- Parameters:
directory- the destination directory- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoryis nullIllegalArgumentException- ifdirectoryis empty
-
destinationDirectory
Provides the destination directory in which the archive will be created.- Parameters:
directory- the destination directory- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoryis null
-
destinationDirectory
Provides the destination directory in which the archive will be created.- Parameters:
directory- the destination directory- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoryis null
-
destinationDirectory
Retrieves the destination directory in which the archive will be created.- Returns:
- the destination directory
-
destinationFileName
Provides the file name that will be used for the archive creation.- Parameters:
name- the archive file name- Returns:
- this operation instance
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnameis empty
-
destinationFileName
Retrieves the file name that will be used for the archive creation.- Returns:
- the archive file name
-
fromProject
Configures the operation from aProject.- Parameters:
project- the project- Returns:
- this operation instance
-
infLibs
Provides the libraries that will be stored inBOOT-INForWEB-INF.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
infLibs
Provides the libraries that will be stored inBOOT-INForWEB-INF.- Parameters:
jars- a collection of Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
infLibs
Provides the libraries that will be stored inBOOT-INForWEB-INF.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
infLibs
Provides the libraries that will be stored inBOOT-INForWEB-INF.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
infLibs
Retrieves the libraries inBOOT-INForWEB-INF.- Returns:
- the Java archives
-
infLibsPaths
Provides the libraries that will be stored inBOOT-INForWEB-INF.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
infLibsStrings
Provides the libraries that will be stored inBOOT-INForWEB-INF.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
launcherClass
Provides the Spring Boot loader launcher fully qualified class name.For examples:
org.springframework.boot.loader.JarLauncherorg.springframework.boot.loader.PropertiesLauncherorg.springframework.boot.loader.WarLauncher
- Parameters:
className- the launcher class name- Returns:
- this operation instance
- Throws:
NullPointerException- ifclassNameis nullIllegalArgumentException- ifclassNameis empty
-
launcherLibs
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars- one or more Java archives- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
launcherLibs
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars- a collection of Java archives- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
launcherLibs
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars- one or more Java archives- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
launcherLibs
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars- one or more Java archives- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
launcherLibs
Retrieves the Spring Boot loader launcher libraries.- Returns:
- the Java archives
-
launcherLibsPaths
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars- one or more Java archives- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
launcherLibsStrings
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars- one or more Java archives- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
mainClass
Retrieves the main class name.- Returns:
- the class name
-
manifestAttribute
Provides an attribute to put in the archive manifest.- Parameters:
name- the attribute namevalue- the attribute value- Returns:
- this operation instance
- Throws:
NullPointerException- ifnameorvalueis nullIllegalArgumentException- ifnameorvalueis empty
-
manifestAttributes
Retrieves the attributes that will be put in the archive manifest.- Returns:
- the manifest attributes
-
manifestAttributes
Provides a map of attributes to put in the archive manifest.- Parameters:
attributes- the manifest attributes- Returns:
- this operation instance
- Throws:
NullPointerException- ifattributesis nullIllegalArgumentException- ifattributesis empty, or containsnullor empty elements- See Also:
-
sourceDirectories
Provides source directories that will be used for the archive creation.- Parameters:
directories- one or more source directories- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoriesis nullIllegalArgumentException- ifdirectoriesis empty, or containsnullor empty elements- See Also:
-
sourceDirectories
Provides source directories that will be used for the archive creation.- Parameters:
directories- one or more source directories- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoriesis nullIllegalArgumentException- ifdirectoriesis empty, or containsnullor empty elements- See Also:
-
sourceDirectories
Provides source directories that will be used for the archive creation.- Parameters:
directories- one or more source directories- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoriesis nullIllegalArgumentException- ifdirectoriesis empty, or containsnullor empty elements- See Also:
-
sourceDirectories
Provides source directories that will be used for the archive creation.- Parameters:
directories- one or more source directories- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoriesis nullIllegalArgumentException- ifdirectoriesis empty, or containsnullor empty elements- See Also:
-
sourceDirectories
Retrieves the source directories that will be used for the archive creation.- Returns:
- the source directories
-
sourceDirectoriesPaths
Provides source directories that will be used for the archive creation.- Parameters:
directories- one or more source directories- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoriesis nullIllegalArgumentException- ifdirectoriesis empty, or containsnullor empty elements- See Also:
-
sourceDirectoriesStrings
Provides source directories that will be used for the archive creation.- Parameters:
directories- one or more source directories- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoriesis nullIllegalArgumentException- ifdirectoriesis empty, or containsnullor empty elements- See Also:
-
executeCopyBootLoader
protected void executeCopyBootLoader(File stagingDirectory) throws FileUtilsErrorException, ExitStatusException Part of theexecuteoperation, copies the Spring Boot loader launcher archive content to the staging directory.- Parameters:
stagingDirectory- the staging directory- Throws:
FileUtilsErrorException- if an error occursExitStatusException- if the launcher libraries are missing
-
executeCopyInfClassesFiles
- Parameters:
stagingInfDirectory- the stagingINFdirectory- Throws:
IOException- if an error occurs
-
executeCopyInfLibs
- Parameters:
stagingInfDirectory- the stagingINFdirectory- Throws:
IOException- if an error occurs
-
executeCreateArchive
Part of theexecuteoperation, creates the archive from the staging directory.- Parameters:
stagingDirectory- the staging directory- Returns:
- the archive
- Throws:
IOException- if an error occurs
-
executeCreateManifest
Part of theexecuteoperation, creates the manifest for the archive.- Parameters:
stagingDirectory- the staging directory- Throws:
IOException- if an error occurs
-
launcherClass
Retrieves the Spring Boot loader launcher fully qualified class name.- Returns:
- the launcher class name, or
nullif not set
-
mainClass
Provides the fully qualified main class name.- Parameters:
className- the class name- Returns:
- this operation instance
-
verifyExecute
Verifies that all the elements (mainClass,launcherClassandlauncherLibs) required to create the archive have been provided, throws anIllegalArgumentExceptionotherwise.- Throws:
IOException- if thedestination directorycould not be createdIllegalArgumentException- if a required element is missing or invalid
-