Class BootWar
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.AbstractCopyTask
org.gradle.api.tasks.bundling.AbstractArchiveTask
org.gradle.api.tasks.bundling.Zip
org.gradle.jvm.tasks.Jar
org.gradle.api.tasks.bundling.Jar
org.gradle.api.tasks.bundling.War
org.springframework.boot.gradle.tasks.bundling.BootWar
- All Implemented Interfaces:
Comparable<Task>
,ContentFilterable
,CopyProcessingSpec
,CopySourceSpec
,CopySpec
,org.gradle.api.internal.DynamicObjectAware
,org.gradle.api.internal.file.copy.CopySpecSource
,org.gradle.api.internal.IConventionAware
,org.gradle.api.internal.TaskInternal
,Named
,ExtensionAware
,Task
,PatternFilterable
,Configurable<Task>
,BootArchive
@DisableCachingByDefault(because="Not worth caching")
public abstract class BootWar
extends War
implements BootArchive
A custom
War
task that produces a Spring Boot executable war.- Since:
- 2.0.0
- Author:
- Andy Wilkinson, Phillip Webb, Scott Frederick
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
Task.Namer
-
Field Summary
Fields inherited from class org.gradle.api.tasks.bundling.War
WAR_EXTENSION
Fields inherited from class org.gradle.jvm.tasks.Jar
DEFAULT_EXTENSION
Fields inherited from class org.gradle.api.tasks.bundling.Zip
ZIP_EXTENSION
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
copy()
protected org.gradle.api.internal.file.copy.CopyAction
Returns theLaunchScriptConfiguration
that will control the script that is prepended to the archive.Returns the spec that describes the layers in a layered jar.Returns the provided classpath, the contents of which will be included in theWEB-INF/lib-provided
directory of the war.protected boolean
isLibrary
(FileCopyDetails details) Return if theFileCopyDetails
are for a library.void
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 givenaction
.void
layered
(Action<LayeredSpec> action) Configures the war's layering using the givenaction
.void
providedClasspath
(Object... classpath) Adds files to the provided classpath to include in theWEB-INF/lib-provided
directory of the war.void
requiresUnpack
(String... patterns) Adds Ant-style patterns that identify files that must be unpacked from the archive when it is launched.void
requiresUnpack
(Spec<FileTreeElement> spec) Adds a spec that identifies files that must be unpacked from the archive when it is launched.void
resolvedArtifacts
(Provider<Set<ResolvedArtifactResult>> resolvedArtifacts) Registers the given lazily providedresolvedArtifacts
.protected ZipCompression
resolveZipCompression
(FileCopyDetails details) Return theZipCompression
that should be used when adding the file represented by the givendetails
to the jar.void
setProvidedClasspath
(Object classpath) Sets the provided classpath to include in theWEB-INF/lib-provided
directory of the war.void
setProvidedClasspath
(FileCollection classpath) Sets the provided classpath to include in theWEB-INF/lib-provided
directory of the war.Methods inherited from class org.gradle.api.tasks.bundling.War
classpath, getClasspath, getObjectFactory, getWebAppDirectory, getWebInf, getWebXml, setClasspath, setClasspath, setWebXml, webInf, webInf
Methods inherited from class org.gradle.jvm.tasks.Jar
getManifest, getManifestContentCharset, getMetadataCharset, getMetaInf, manifest, metaInf, metaInf, setManifest, setManifestContentCharset, setMetadataCharset
Methods inherited from class org.gradle.api.tasks.bundling.Zip
getCompressor, getEntryCompression, isZip64, setEntryCompression, setZip64
Methods inherited from class org.gradle.api.tasks.bundling.AbstractArchiveTask
createCopyActionExecuter, getArchiveAppendix, getArchiveBaseName, getArchiveClassifier, getArchiveExtension, getArchiveFile, getArchiveFileName, getArchivePath, getArchiveVersion, getDestinationDirectory, into, into, into, isPreserveFileTimestamps, isReproducibleFileOrder, setPreserveFileTimestamps, setReproducibleFileOrder
Methods inherited from class org.gradle.api.tasks.AbstractCopyTask
createRootSpec, dirPermissions, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, expand, filePermissions, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDirectoryFileTreeFactory, getDirMode, getDirPermissions, getDocumentationRegistry, getDuplicatesStrategy, getExcludes, getFileLookup, getFileMode, getFilePermissions, 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, with
Methods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMapping
Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
Methods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.boot.gradle.tasks.bundling.BootArchive
classpath, getClasspath, getIncludeTools, getLoaderImplementation, getMainClass, getTargetJavaVersion, setClasspath, setClasspath
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.gradle.api.plugins.ExtensionAware
getExtensions
Methods inherited from interface org.gradle.api.Task
configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, doNotTrackState, finalizedBy, getActions, getAnt, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getFinalizedBy, getGroup, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getPath, getProject, getShouldRunAfter, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, notCompatibleWithConfigurationCache, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
-
Constructor Details
-
BootWar
public BootWar()Creates a newBootWar
task.
-
-
Method Details
-
resolvedArtifacts
Description copied from interface:BootArchive
Registers the given lazily providedresolvedArtifacts
. They are used to map from the files in theclasspath
to their dependency coordinates.- Specified by:
resolvedArtifacts
in interfaceBootArchive
- Parameters:
resolvedArtifacts
- the lazily provided resolved artifacts
-
copy
public void copy()- Overrides:
copy
in classAbstractCopyTask
-
createCopyAction
protected org.gradle.api.internal.file.copy.CopyAction createCopyAction()- Overrides:
createCopyAction
in classZip
-
requiresUnpack
Description copied from interface:BootArchive
Adds Ant-style patterns that identify files that must be unpacked from the archive when it is launched.- Specified by:
requiresUnpack
in interfaceBootArchive
- Parameters:
patterns
- the patterns
-
requiresUnpack
Description copied from interface:BootArchive
Adds a spec that identifies files that must be unpacked from the archive when it is launched.- Specified by:
requiresUnpack
in interfaceBootArchive
- Parameters:
spec
- the spec
-
getLaunchScript
Description copied from interface:BootArchive
Returns theLaunchScriptConfiguration
that will control the script that is prepended to the archive.- Specified by:
getLaunchScript
in interfaceBootArchive
- Returns:
- the launch script configuration, or
null
if the launch script has not been configured.
-
launchScript
public void launchScript()Description copied from interface:BootArchive
Configures the archive to have a prepended launch script.- Specified by:
launchScript
in interfaceBootArchive
-
launchScript
Description copied from interface:BootArchive
Configures the archive to have a prepended launch script, customizing its configuration using the givenaction
.- Specified by:
launchScript
in interfaceBootArchive
- Parameters:
action
- the action to apply
-
getProvidedClasspath
Returns the provided classpath, the contents of which will be included in theWEB-INF/lib-provided
directory of the war.- Returns:
- the provided classpath
-
providedClasspath
Adds files to the provided classpath to include in theWEB-INF/lib-provided
directory of the war. The givenclasspath
is evaluated as perProject.files(Object...)
.- Parameters:
classpath
- the additions to the classpath
-
setProvidedClasspath
Sets the provided classpath to include in theWEB-INF/lib-provided
directory of the war.- Parameters:
classpath
- the classpath- Since:
- 2.0.7
-
setProvidedClasspath
Sets the provided classpath to include in theWEB-INF/lib-provided
directory of the war. The givenclasspath
is evaluated as perProject.files(Object...)
.- Parameters:
classpath
- the classpath- Since:
- 2.0.7
-
resolveZipCompression
Return theZipCompression
that should be used when adding the file represented by the givendetails
to the jar. By default, anylibrary
isstored
and all other files aredeflated
.- Parameters:
details
- the file copy details- Returns:
- the compression to use
-
getLayered
Returns the spec that describes the layers in a layered jar.- Returns:
- the spec for the layers
- Since:
- 2.5.0
-
layered
Configures the war's layering using the givenaction
.- Parameters:
action
- the action to apply- Since:
- 2.5.0
-
isLibrary
Return if theFileCopyDetails
are for a library. By default any file inWEB-INF/lib
orWEB-INF/lib-provided
is considered to be a library.- Parameters:
details
- the file copy details- Returns:
true
if the details are for a library
-