For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

manifest

open fun manifest(@DelegatesTo(value = Manifest::class) configureClosure: Closure<out Any>): Jar(source)

Configures the manifest for this JAR archive.

The given closure is executed to configure the manifest. The org.gradle.api.java.archives.Manifest is passed to the closure as its delegate.

Return

This.

Since

2.3

Parameters

configureClosure

The closure.


open fun manifest(configureAction: Action<in Manifest>): Jar(source)

Configures the manifest for this JAR archive.

The given action is executed to configure the manifest.

plugins {
    id 'java'
}

def buildNumber = providers.gradleProperty('buildNumber').orElse('0')

tasks.named('jar', Jar) {
    manifest {
        attributes('Build-Number': buildNumber)
    }
}

Return

This.

Since

3.5

Parameters

configureAction

The action.

See also