Package: org.gradle.api.tasks.bundling

## [Groovy] Class War

- org.gradle.api.tasks.bundling.War

- Assembles a WAR archive.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `WAR_EXTENSION` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class Jar` | `DEFAULT_EXTENSION`
    `class Zip` | `ZIP_EXTENSION`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `War ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `classpath(Object... classpath)` Adds files to the classpath to include in the WAR archive.
    `FileCollection` | `getClasspath()` Returns the classpath to include in the WAR archive.
    `CopySpec` | `getWebInf()`
    `File` | `getWebXml()` Returns the `web.xml` file to include in the WAR archive.
    `void` | `setClasspath(Object classpath)` Sets the classpath to include in the WAR archive.
    `void` | `setWebXml(File webXml)` Sets the `web.xml` file to include in the WAR archive.
    `CopySpec` | `webInf(Closure configureClosure)` Adds some content to the `WEB-INF` directory for this WAR archive.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Jar` | `getManifest, getMetaInf, manifest, metaInf, setManifest`
    `class Zip` | `createCopyAction, getCompressor, getEntryCompression, isZip64, setEntryCompression, setZip64`
    `class AbstractArchiveTask` | `getAppendix, getArchiveName, getArchivePath, getBaseName, getClassifier, getDestinationDir, getExtension, getVersion, into, into, setAppendix, setArchiveName, setBaseName, setClassifier, setDestinationDir, setExtension, setVersion`
    `class AbstractCopyTask` | `copy, createCopyAction, createRootSpec, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, filesMatching, filesNotMatching, filter, filter, filter, from, from, getDirMode, getDuplicatesStrategy, getExcludes, getFileLookup, getFileMode, getFileResolver, getFileSystem, getIncludeEmptyDirs, getIncludes, getInstantiator, getMainSpec, getRootSpec, getSource, include, include, include, include, into, into, isCaseSensitive, rename, rename, rename, setCaseSensitive, setDirMode, setDuplicatesStrategy, setExcludes, setFileMode, setIncludeEmptyDirs, setIncludes, with`

- - ### Field Detail

    - #### public static final String WAR_EXTENSION

  - ### Constructor Detail

    - #### War()

  - ### Method Detail

    - #### void classpath(Object... classpath)

      Adds files to the classpath to include in the WAR archive.

      Parameters:
        `classpath` - The files to add. These are evaluated as per Project.files

    - #### @InputFiles @Optional FileCollection getClasspath()

      Returns the classpath to include in the WAR archive. Any JAR or ZIP files in this classpath are included in the `WEB-INF/lib` directory. Any directories in this classpath are included in the `WEB-INF/classes` directory.

      Returns:
        The classpath. Returns an empty collection when there is no classpath to include in the WAR.

    - #### CopySpec getWebInf()

    - #### @InputFile @Optional File getWebXml()

      Returns the `web.xml` file to include in the WAR archive. When `null`, no `web.xml` file is included in the WAR.

      Returns:
        The `web.xml` file.

    - #### void setClasspath(Object classpath)

      Sets the classpath to include in the WAR archive.

      Parameters:
        `classpath` - The classpath. Must not be null.

    - #### void setWebXml(File webXml)

      Sets the `web.xml` file to include in the WAR archive. When `null`, no `web.xml` file is included in the WAR.

      Parameters:
        `webXml` - The `web.xml` file. Maybe null.

    - #### CopySpec webInf(Closure configureClosure)

      Adds some content to the `WEB-INF` directory for this WAR archive.

      The given closure is executed to configure a CopySpec. The `CopySpec` is passed to the closure as its delegate.

      Parameters:
        `configureClosure` - The closure to execute
      Returns:
        The newly created `CopySpec`.