Package rife.bld.extension
Class BootWarOperation
Builds and creates a Spring Boot executable web archive (WAR).
Usage:
@BuildCommand(summary = "Creates an executable WAR for the project")
public void bootwar() throws Exception {
new BootWarOperation()
.fromProject(this)
.execute();
}
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Field Summary
Fields inherited from class rife.bld.extension.AbstractBootOperation
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Performs the BootWar operation.protected voidexecuteCopyWebInfProvidedLib(File stagingWebInfDirectory) Part of theexecuteoperation, copies theWEB-INF/lib-providedlibraries.fromProject(Project project) Configures the operation from aProject.Retrieves the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.providedLibs(File... jars) Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.providedLibs(String... jars) Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.providedLibs(Path... jars) Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.final BootWarOperationprovidedLibs(Collection<File> jars) Provides libraries that will be used for the WAR creation in/WEB-INF/lib-provided.final BootWarOperationprovidedLibsPaths(Collection<Path> jars) Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.final BootWarOperationprovidedLibsStrings(Collection<String> jars) Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.Methods inherited from class rife.bld.extension.AbstractBootOperation
destinationDirectory, destinationDirectory, destinationDirectory, destinationDirectory, destinationFileName, destinationFileName, executeCopyBootLoader, executeCopyInfClassesFiles, executeCopyInfLibs, executeCreateArchive, executeCreateManifest, infLibs, infLibs, infLibs, infLibs, infLibs, infLibsPaths, infLibsStrings, launcherClass, launcherClass, launcherLibs, launcherLibs, launcherLibs, launcherLibs, launcherLibs, launcherLibsPaths, launcherLibsStrings, mainClass, mainClass, manifestAttribute, manifestAttributes, manifestAttributes, sourceDirectories, sourceDirectories, sourceDirectories, sourceDirectories, sourceDirectories, sourceDirectoriesPaths, sourceDirectoriesStrings, verifyExecuteMethods inherited from class rife.bld.operations.AbstractOperation
executeOnce, executeOnce, silent, silent
-
Constructor Details
-
BootWarOperation
public BootWarOperation()
-
-
Method Details
-
execute
Performs the BootWar operation.- Specified by:
executein classAbstractOperation<AbstractBootOperation<BootWarOperation>>- Throws:
Exception
-
fromProject
Configures the operation from aProject.Sets the following:
- The
destination file nametoarchiveBaseNameandversion - The
INF libstocompileClasspathJars,runtimeClasspathJarsandbuildDistDirectory - The
launcher classtoWarLauncher - The
launcher libstostandaloneClasspathJars - The
main classtomainClass - The
Manifest-Version,Main-ClassandStart-Classmanifest attributes - The
source directoriestobuildMainDirectoryandsrcMainResourcesDirectory
The project
main classandversionmust be defined.- Specified by:
fromProjectin classAbstractBootOperation<BootWarOperation>- Parameters:
project- the project- Returns:
- this operation instance
- Throws:
NullPointerException- if theproject,versionormain classarenullIllegalArgumentException- if themain classis blank or empty.
- The
-
providedLibs
Provides libraries that will be used for the WAR creation in/WEB-INF/lib-provided.- Parameters:
jars- a collection of Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
providedLibs
Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
providedLibs
Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
providedLibs
Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
providedLibs
Retrieves the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.- Returns:
- the list of Java archive files.
-
providedLibsPaths
Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
providedLibsStrings
Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.- Parameters:
jars- one or more Java archive files- Returns:
- this operation instance
- Throws:
NullPointerException- ifjarsis nullIllegalArgumentException- ifjarsis empty, or containsnullor empty elements- See Also:
-
executeCopyWebInfProvidedLib
Part of theexecuteoperation, copies theWEB-INF/lib-providedlibraries.- Parameters:
stagingWebInfDirectory- the stagingWEB-INFdirectory- Throws:
IOException- if an error occurs
-