public class BootWar extends War implements BootArchive
War task that produces a Spring Boot executable war.Task.NamerWAR_EXTENSIONDEFAULT_EXTENSIONZIP_EXTENSIONTASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE| Constructor and Description |
|---|
BootWar()
Creates a new
BootWar task. |
| Modifier and Type | Method and Description |
|---|---|
void |
copy() |
protected org.gradle.api.internal.file.copy.CopyAction |
createCopyAction() |
LaunchScriptConfiguration |
getLaunchScript()
Returns the
LaunchScriptConfiguration that will control the script that is
prepended to the archive. |
String |
getMainClass()
Returns the main class of the application.
|
FileCollection |
getProvidedClasspath()
Returns the provided classpath, the contents of which will be included in the
WEB-INF/lib-provided directory of the war. |
boolean |
isExcludeDevtools()
Returns
true if the Devtools jar should be excluded, otherwise
false. |
void |
launchScript()
Configures the archive to have a prepended launch script.
|
void |
launchScript(Action<LaunchScriptConfiguration> action)
Configures the archive to have a prepended launch script, customizing its
configuration using the given
action. |
void |
providedClasspath(Object... classpath)
Adds files to the provided classpath to include in the
WEB-INF/lib-provided
directory of the war. |
void |
requiresUnpack(Spec<FileTreeElement> spec)
Adds a spec that identifies files that must be unpacked from the archive when it is
launched.
|
void |
requiresUnpack(String... patterns)
Adds Ant-style patterns that identify files that must be unpacked from the archive
when it is launched.
|
protected ZipCompression |
resolveZipCompression(FileCopyDetails details)
Returns the
ZipCompression that should be used when adding the file
represented by the given details to the jar. |
void |
setExcludeDevtools(boolean excludeDevtools)
Sets whether or not the Devtools jar should be excluded.
|
void |
setMainClass(String mainClass)
Sets the main class of the application.
|
classpath, getClasspath, getWebInf, getWebXml, setClasspath, setClasspath, setWebXml, webInf, webInfgetManifest, getManifestContentCharset, getMetadataCharset, getMetaInf, manifest, metaInf, metaInf, setManifest, setManifestContentCharset, setMetadataCharsetgetCompressor, getEntryCompression, isZip64, setEntryCompression, setZip64createCopyActionExecuter, getAppendix, getArchiveName, getArchivePath, getBaseName, getClassifier, getDestinationDir, getExtension, getVersion, into, into, into, isPreserveFileTimestamps, isReproducibleFileOrder, setAppendix, setArchiveName, setBaseName, setClassifier, setDestinationDir, setExtension, setPreserveFileTimestamps, setReproducibleFileOrder, setVersioncreateRootSpec, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDirectoryFileTreeFactory, getDirMode, getDuplicatesStrategy, getExcludes, getFileLookup, getFileMode, getFileResolver, getFileSystem, getFilteringCharset, getIncludeEmptyDirs, getIncludes, getInstantiator, getMainSpec, getRootSpec, getSource, include, include, include, include, isCaseSensitive, rename, rename, rename, rename, setCaseSensitive, setDirMode, setDuplicatesStrategy, setExcludes, setFileMode, setFilteringCharset, setIncludeEmptyDirs, setIncludes, withconventionMapping, conventionMapping, getConventionMappingaddValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclasspath, getClasspathconfigure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, finalizedBy, getActions, getAnt, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getFinalizedBy, getGroup, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, hasProperty, leftShift, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAftercompareTogetExtensionspublic void copy()
copy in class AbstractCopyTaskprotected org.gradle.api.internal.file.copy.CopyAction createCopyAction()
createCopyAction in class Zippublic String getMainClass()
BootArchivegetMainClass in interface BootArchivepublic void setMainClass(String mainClass)
BootArchivesetMainClass in interface BootArchivemainClass - the main class of the applicationpublic void requiresUnpack(String... patterns)
BootArchiverequiresUnpack in interface BootArchivepatterns - the patternspublic void requiresUnpack(Spec<FileTreeElement> spec)
BootArchiverequiresUnpack in interface BootArchivespec - the specpublic LaunchScriptConfiguration getLaunchScript()
BootArchiveLaunchScriptConfiguration that will control the script that is
prepended to the archive.getLaunchScript in interface BootArchivenull if the launch script has
not been configured.public void launchScript()
BootArchivelaunchScript in interface BootArchivepublic void launchScript(Action<LaunchScriptConfiguration> action)
BootArchiveaction.launchScript in interface BootArchiveaction - the action to apply@Optional public FileCollection getProvidedClasspath()
WEB-INF/lib-provided directory of the war.public void providedClasspath(Object... classpath)
WEB-INF/lib-provided
directory of the war. The given classpath are evaluated as per
Project.files(Object...).classpath - the additions to the classpathpublic boolean isExcludeDevtools()
BootArchivetrue if the Devtools jar should be excluded, otherwise
false.isExcludeDevtools in interface BootArchivetrue if the Devtools jar should be excluded, or false if
notpublic void setExcludeDevtools(boolean excludeDevtools)
BootArchivesetExcludeDevtools in interface BootArchiveexcludeDevtools - true if the Devtools jar should be excluded, or
false if notprotected ZipCompression resolveZipCompression(FileCopyDetails details)
ZipCompression that should be used when adding the file
represented by the given details to the jar.
By default, any file in WEB-INF/lib/ or WEB-INF/lib-provided/ is
stored and all other files are deflated.
details - the details