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
-
Constructor Summary
-
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 void
executeCopyBootLoader
(File stagingDirectory) Part of theexecute
operation, copies the Spring Boot loader launcher archive content to the staging directory.protected void
executeCopyInfClassesFiles
(File stagingInfDirectory) protected void
executeCopyInfLibs
(File stagingInfDirectory) Part of theexecute
operation, copies theBOOT-INF
or (@code WEB-INF) libs.protected File
executeCreateArchive
(File stagingDirectory) Part of theexecute
operation, creates the archive from the staging directory.protected void
executeCreateManifest
(File stagingDirectory) Part of theexecute
operation, creates the manifest for the archive.abstract T
fromProject
(Project project) Configures the operation from aProject
.infLibs()
Retrieves the libraries inBOOT-INF
orWEB-INF
.Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.infLibs
(Collection<File> jars) Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.infLibsPaths
(Collection<Path> jars) Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.infLibsStrings
(Collection<String> jars) Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.protected String
Retrieves 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.launcherLibs
(Collection<File> jars) Provides the libraries for the Spring Boot loader launcher.launcherLibsPaths
(Collection<Path> jars) Provides the libraries for the Spring Boot loader launcher.launcherLibsStrings
(Collection<String> jars) Provides the libraries for the Spring Boot loader launcher.Retrieves the main class name.protected T
Provides 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.sourceDirectories
(Collection<File> directories) Provides source directories that will be used for the archive creation.sourceDirectoriesPaths
(Collection<Path> directories) Provides source directories that will be used for the archive creation.sourceDirectoriesStrings
(Collection<String> directories) Provides source directories that will be used for the archive creation.protected boolean
Verifies that all the elements (mainClass
,launcherClass
andlauncherLibs
) required to create the archive have been provided, throws anIllegalArgumentException
otherwise.Methods inherited from class rife.bld.operations.AbstractOperation
execute, executeOnce, executeOnce, silent, silent
-
Constructor Details
-
AbstractBootOperation
public AbstractBootOperation()
-
-
Method Details
-
destinationDirectory
Retrieves the destination directory in which the archive will be created.- Returns:
- the destination directory
-
destinationDirectory
Provides the destination directory in which the archive will be created.- Parameters:
directory
- the destination directory- Returns:
- this operation instance
- Throws:
IOException
- if an error occurs
-
destinationDirectory
Provides the destination directory in which the archive will be created.- Parameters:
directory
- the destination directory- Returns:
- this operation instance
- Throws:
IOException
- if an error occurs
-
destinationDirectory
Provides the destination directory in which the archive will be created.- Parameters:
directory
- the destination directory- Returns:
- this operation instance
- Throws:
IOException
- if an error occurs
-
destinationFileName
Provides the file name that will be used for the archive creation.- Parameters:
name
- the archive file name- Returns:
- this operation instance
-
destinationFileName
Retrieves the file name that will be used for the archive creation.- Returns:
- the archive file name
-
executeCopyBootLoader
protected void executeCopyBootLoader(File stagingDirectory) throws FileUtilsErrorException, ExitStatusException Part of theexecute
operation, copies the Spring Boot loader launcher archive content to the staging directory.- Parameters:
stagingDirectory
- the staging directory- Throws:
FileUtilsErrorException
- if an error occursExitStatusException
-
executeCopyInfClassesFiles
- Parameters:
stagingInfDirectory
- Tte stagingINF
directory- Throws:
IOException
- if an error occurs
-
executeCopyInfLibs
Part of theexecute
operation, copies theBOOT-INF
or (@code WEB-INF) libs.- Parameters:
stagingInfDirectory
- the stagingINF
directory- Throws:
IOException
- if an error occurs
-
executeCreateArchive
Part of theexecute
operation, creates the archive from the staging directory.- Parameters:
stagingDirectory
- the staging directory- Returns:
- the archive
- Throws:
IOException
- if an error occurs
-
executeCreateManifest
Part of theexecute
operation, creates the manifest for the archive.- Parameters:
stagingDirectory
- the staging directory- Throws:
IOException
- if an error occurs
-
fromProject
Configures the operation from aProject
.- Parameters:
project
- the project- Returns:
- this operation instance
- Throws:
IOException
- if an error occurs
-
infLibs
Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.- Parameters:
jars
- a collection of Java archive files- Returns:
- this operation instance
- See Also:
-
infLibs
Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.- Parameters:
jars
- one or more Java archive files- Returns:
- this operation instance
- See Also:
-
infLibs
Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.- Parameters:
jars
- one or more Java archive files- Returns:
- this operation instance
- See Also:
-
infLibs
Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.- Parameters:
jars
- one or more Java archive files- Returns:
- this operation instance
- See Also:
-
infLibs
Retrieves the libraries inBOOT-INF
orWEB-INF
.- Returns:
- the Java archives
-
infLibsPaths
Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.- Parameters:
jars
- one or more Java archive files- Returns:
- this operation instance
- See Also:
-
infLibsStrings
Provides the libraries that will be stored inBOOT-INF
orWEB-INF
.- Parameters:
jars
- one or more Java archive files- Returns:
- this operation instance
- See Also:
-
launcherClass
Provides the Spring Boot loader launcher fully-qualified class name.For examples:
org.springframework.boot.loader.JarLauncher
org.springframework.boot.loader.PropertiesLauncher
org.springframework.boot.loader.WarLauncher
- Parameters:
className
- the launcher class name- Returns:
- this operation instance
-
launcherClass
Retrieves the Spring Boot loader launcher fully-qualified class name.- Returns:
- the launcher class name
-
launcherLibs
Retrieves the Spring Boot loader launcher libraries.- Returns:
- the Java archives
-
launcherLibs
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars
- a collection of Java archives- Returns:
- this operation instance
- Throws:
IOException
- if a JAR could not be found- See Also:
-
launcherLibs
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars
- one or more Java archives- Returns:
- this operation instance
- Throws:
IOException
- if a JAR could not be found- See Also:
-
launcherLibs
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars
- one or more Java archives- Returns:
- this operation instance
- Throws:
IOException
- if a JAR could not be found- See Also:
-
launcherLibs
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars
- one or more Java archives- Returns:
- this operation instance
- Throws:
IOException
- if a JAR could not be found- See Also:
-
launcherLibsPaths
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars
- one or more Java archives- Returns:
- this operation instance
- Throws:
IOException
- if a JAR could not be found- See Also:
-
launcherLibsStrings
Provides the libraries for the Spring Boot loader launcher.- Parameters:
jars
- one or more Java archives- Returns:
- this operation instance
- Throws:
IOException
- if a JAR could not be found- See Also:
-
mainClass
Provides the fully-qualified main class name.- Parameters:
className
- the class name- Returns:
- this operation instance
-
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
-
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
- 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
- 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
- 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
- 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
- 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
- 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
- See Also:
-
verifyExecute
Verifies that all the elements (mainClass
,launcherClass
andlauncherLibs
) required to create the archive have been provided, throws anIllegalArgumentException
otherwise.- Returns:
true
or anIllegalArgumentException
- Throws:
IllegalArgumentException
- if an error occurs
-