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 Named
Named.Namer -
Field Summary
Fields inherited from class War
WAR_EXTENSIONFields inherited from class Jar
DEFAULT_EXTENSIONFields inherited from class Zip
ZIP_EXTENSIONFields inherited from interface Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy()protected org.gradle.api.internal.file.copy.CopyActionReturns the spec that describes the layers in a layered jar.@Nullable FileCollectionReturns the provided classpath, the contents of which will be included in theWEB-INF/lib-provideddirectory of the war.protected booleanisLibrary(FileCopyDetails details) Return if theFileCopyDetailsare for a library.voidlayered(Action<LayeredSpec> action) Configures the war's layering using the givenaction.voidprovidedClasspath(Object... classpath) Adds files to the provided classpath to include in theWEB-INF/lib-provideddirectory of the war.voidrequiresUnpack(String... patterns) Adds Ant-style patterns that identify files that must be unpacked from the archive when it is launched.voidrequiresUnpack(Spec<FileTreeElement> spec) Adds a spec that identifies files that must be unpacked from the archive when it is launched.voidresolvedArtifacts(Provider<Set<ResolvedArtifactResult>> resolvedArtifacts) Registers the given lazily providedresolvedArtifacts.protected ZipCompressionresolveZipCompression(FileCopyDetails details) Return theZipCompressionthat should be used when adding the file represented by the givendetailsto the jar.voidsetProvidedClasspath(Object classpath) Sets the provided classpath to include in theWEB-INF/lib-provideddirectory of the war.voidsetProvidedClasspath(FileCollection classpath) Sets the provided classpath to include in theWEB-INF/lib-provideddirectory of the war.Methods inherited from class War
classpath, getClasspath, getObjectFactory, getWebAppDirectory, getWebInf, getWebXml, setClasspath, setClasspath, setWebXml, webInf, webInfMethods inherited from class Jar
getManifest, getManifestContentCharset, getMetadataCharset, getMetaInf, manifest, metaInf, metaInf, setManifest, setManifestContentCharset, setMetadataCharsetMethods inherited from class Zip
getCompressor, getEntryCompression, isZip64, setEntryCompression, setZip64Methods inherited from class AbstractArchiveTask
createCopyActionExecuter, getArchiveAppendix, getArchiveBaseName, getArchiveClassifier, getArchiveExtension, getArchiveFile, getArchiveFileName, getArchiveVersion, getDestinationDirectory, getFileSystemOperations, into, into, into, isPreserveFileTimestamps, isReproducibleFileOrder, setPreserveFileTimestamps, setReproducibleFileOrder, useFileSystemPermissionsMethods inherited from class AbstractCopyTask
createRootSpec, dirPermissions, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, expand, filePermissions, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDirectoryFileTreeFactory, getDirPermissions, getDocumentationRegistry, getDuplicatesStrategy, getExcludes, getFileLookup, getFilePermissions, getFileResolver, getFileSystem, getFilteringCharset, getIncludeEmptyDirs, getIncludes, getInstantiator, getMainSpec, getPropertyFactory, getRootSpec, getSource, include, include, include, include, isCaseSensitive, rename, rename, rename, rename, setCaseSensitive, setDuplicatesStrategy, setExcludes, setFilteringCharset, setIncludeEmptyDirs, setIncludes, withMethods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMappingMethods inherited from class 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, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BootArchive
classpath, getClasspath, getIncludeTools, getMainClass, getTargetJavaVersion, setClasspath, setClasspathMethods inherited from interface Comparable
compareToMethods inherited from interface ExtensionAware
getExtensionsMethods inherited from interface Task
configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, doNotTrackState, finalizedBy, getActions, getAnt, 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 newBootWartask.
-
-
Method Details
-
resolvedArtifacts
Description copied from interface:BootArchiveRegisters the given lazily providedresolvedArtifacts. They are used to map from the files in theclasspathto their dependency coordinates.- Specified by:
resolvedArtifactsin interfaceBootArchive- Parameters:
resolvedArtifacts- the lazily provided resolved artifacts
-
copy
public void copy()- Overrides:
copyin classAbstractCopyTask
-
createCopyAction
protected org.gradle.api.internal.file.copy.CopyAction createCopyAction()- Overrides:
createCopyActionin classZip
-
requiresUnpack
Description copied from interface:BootArchiveAdds Ant-style patterns that identify files that must be unpacked from the archive when it is launched.- Specified by:
requiresUnpackin interfaceBootArchive- Parameters:
patterns- the patterns
-
requiresUnpack
Description copied from interface:BootArchiveAdds a spec that identifies files that must be unpacked from the archive when it is launched.- Specified by:
requiresUnpackin interfaceBootArchive- Parameters:
spec- the spec
-
getProvidedClasspath
Returns the provided classpath, the contents of which will be included in theWEB-INF/lib-provideddirectory of the war.- Returns:
- the provided classpath
-
providedClasspath
Adds files to the provided classpath to include in theWEB-INF/lib-provideddirectory of the war. The givenclasspathis evaluated as perProject.files(Object...).- Parameters:
classpath- the additions to the classpath
-
setProvidedClasspath
Sets the provided classpath to include in theWEB-INF/lib-provideddirectory of the war.- Parameters:
classpath- the classpath- Since:
- 2.0.7
-
setProvidedClasspath
Sets the provided classpath to include in theWEB-INF/lib-provideddirectory of the war. The givenclasspathis evaluated as perProject.files(Object...).- Parameters:
classpath- the classpath- Since:
- 2.0.7
-
resolveZipCompression
Return theZipCompressionthat should be used when adding the file represented by the givendetailsto the jar. By default, anylibraryisstoredand 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 theFileCopyDetailsare for a library. By default any file inWEB-INF/liborWEB-INF/lib-providedis considered to be a library.- Parameters:
details- the file copy details- Returns:
trueif the details are for a library
-