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();
}
- Author:
- Erik C. Thauvin @since 1.0
-
Field Summary
Fields inherited from class rife.bld.extension.AbstractBootOperation
LOGGER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Performs the BootJar operation.protected voidexecuteCopyWebInfProvidedLib(File stagingWebInfDirectory) Part of theexecuteoperation, copies theWEB-INF/lib-providedlibraries.protected FileexecuteCreateWebInfDirectory(File stagingDirectory) Part of theexecuteoperation, creates theWEB-INFstaging directory.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.providedLibs(Collection<File> jars) Provides libraries that will be used for the WAR creation in/WEB-INF/lib-provided.providedLibsPaths(Collection<Path> jars) Provides the libraries that will be used for the WAR creation in/WEB-INF/lib-provided.providedLibsStrings(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 BootJar operation.- Specified by:
executein classAbstractOperation<AbstractBootOperation<BootWarOperation>>- Throws:
Exception
-
executeCopyWebInfProvidedLib
Part of theexecuteoperation, copies theWEB-INF/lib-providedlibraries.- Parameters:
stagingWebInfDirectory- the stagingWEB-INF/lib-provideddirectory- Throws:
IOException- if an error occurs
-
executeCreateWebInfDirectory
Part of theexecuteoperation, creates theWEB-INFstaging directory.- Parameters:
stagingDirectory- the staging directory- Returns:
- the
WEB-INFdirectory location - Throws:
IOException- if an error occurs
-
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
- Specified by:
fromProjectin classAbstractBootOperation<BootWarOperation>- Parameters:
project- the project- Returns:
- this operation instance
- Throws:
IOException- if an error occurs
- 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
- 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
- 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
- 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
- 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
- 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
- See Also:
-