Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.tasks.bundling
[Groovy] Class War

    java.lang.Object
      org.gradle.api.internal.ConventionTask
          org.gradle.api.tasks.AbstractCopyTask
              org.gradle.api.tasks.bundling.AbstractArchiveTask
                  org.gradle.api.tasks.bundling.Zip
                      org.gradle.api.tasks.bundling.Jar
                          org.gradle.api.tasks.bundling.War

    class War
    extends Jar

Assembles a WAR archive.

Authors:
  Hans Dockter

Field Summary
`static String` | `WAR_EXTENSION`

Fields inherited from class Jar
DEFAULT_EXTENSION

Fields inherited from class Zip
ZIP_EXTENSION

Constructor Summary
`War()`

Method Summary
`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.

Methods inherited from class Jar
getManifest, getMetaInf, manifest, metaInf, setManifest

Methods inherited from class Zip
getCopyAction

Methods inherited from class AbstractArchiveTask
getAppendix, getArchiveName, getArchivePath, getBaseName, getClassifier, getDestinationDir, getExtension, getVersion, into, into, setAppendix, setArchiveName, setBaseName, setClassifier, setDestinationDir, setExtension, setVersion

Methods inherited from class AbstractCopyTask
configureRootSpec, copy, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, filter, filter, filter, from, from, getCopyAction, getDefaultSource, getDirMode, getExcludes, getFileMode, getIncludeEmptyDirs, getIncludes, getMainSpec, getRootSpec, getSource, include, include, include, include, into, into, isCaseSensitive, rename, rename, rename, setCaseSensitive, setDirMode, setExcludes, setFileMode, setIncludeEmptyDirs, setIncludes, with

Field Detail

### WAR_EXTENSION

    public static final String WAR_EXTENSION

Constructor Detail

### War

    War()

Method Detail

### classpath

    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 for Project.files

### getClasspath

    @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.

### getWebInf

    CopySpec getWebInf()

### getWebXml

    @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.

### setClasspath

    void setClasspath(Object classpath)

  Sets the classpath to include in the WAR archive.
  Parameters:
    `classpath` - The classpath. Must not be null.

### setWebXml

    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.

### webInf

    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`.

Gradle API 1.1-rc-1