Package: org.gradle.api.tasks.bundling

## [Groovy] Class Jar

- org.gradle.api.tasks.bundling.Jar

- Assembles a JAR archive.

- - ### Field Summary

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

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

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Jar ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `Manifest` | `getManifest()` Returns the manifest for this JAR archive.
    `CopySpec` | `getMetaInf()`
    `Jar` | `manifest(Closure configureClosure)` Configures the manifest for this JAR archive.
    `CopySpec` | `metaInf(Closure configureClosure)` Adds content to this JAR archive's META-INF directory.
    `void` | `setManifest(Manifest manifest)` Sets the manifest for this JAR archive.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `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 DEFAULT_EXTENSION

  - ### Constructor Detail

    - #### Jar()

  - ### Method Detail

    - #### Manifest getManifest()

      Returns the manifest for this JAR archive.

      Returns:
        The manifest

    - #### CopySpec getMetaInf()

    - #### Jar manifest(Closure configureClosure)

      Configures the manifest for this JAR archive.

      The given closure is executed to configure the manifest. The Manifest is passed to the closure as its delegate.

      Parameters:
        `configureClosure` - The closure.
      Returns:
        This.

    - #### CopySpec metaInf(Closure configureClosure)

      Adds content to this JAR archive's META-INF directory.

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

      Parameters:
        `configureClosure` - The closure.
      Returns:
        The created `CopySpec`

    - #### void setManifest(Manifest manifest)

      Sets the manifest for this JAR archive.

      Parameters:
        `manifest` - The manifest. May be null.