Groovy Documentation

org.gradle.plugins.signing
[Groovy] Class SigningPluginConvention

java.lang.Object
  org.gradle.plugins.signing.SigningPluginConvention

class SigningPluginConvention
extends java.lang.Object

Constructor Summary
SigningPluginConvention(SigningSettings settings)

 
Method Summary
protected SignOperation doSignOperation(groovy.lang.Closure setup)

SigningSettings getSigning()

The signing settings for the project.

SignOperation sign(PublishArtifact... publishArtifacts)

Digitally signs the publish artifacts, generating signature files alongside them.

SignOperation sign(java.io.File... files)

Digitally signs the files, generating signature files alongside them.

SignOperation sign(java.lang.String classifier, java.io.File... files)

Digitally signs the files, generating signature files alongside them.

SignOperation sign(groovy.lang.Closure closure)

Creates a new sign operation using the given closure to configure it before executing it.

Signature signPom(MavenDeployment mavenDeployment, groovy.lang.Closure closure = null)

Signs the POM artifact for the given maven deployment.

SigningSettings signing(groovy.lang.Closure closure)

Configures the signing settings of this project.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

SigningPluginConvention

SigningPluginConvention(SigningSettings settings)


 
Method Detail

doSignOperation

protected SignOperation doSignOperation(groovy.lang.Closure setup)


getSigning

SigningSettings getSigning()
The signing settings for the project.


sign

SignOperation sign(PublishArtifact... publishArtifacts)
Digitally signs the publish artifacts, generating signature files alongside them.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available, the sign operation will fail.

Parameters:
publishArtifacts - The publish artifacts to sign
Returns:
The executed sign operation


sign

SignOperation sign(java.io.File... files)
Digitally signs the files, generating signature files alongside them.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available, the sign operation will fail.

Parameters:
publishArtifacts - The files to sign.
Returns:
The executed sign operation.


sign

SignOperation sign(java.lang.String classifier, java.io.File... files)
Digitally signs the files, generating signature files alongside them.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available, the sign operation will fail.

Parameters:
classifier - The classifier to assign to the created signature artifacts.
publishArtifacts - The publish artifacts to sign.
Returns:
The executed sign operation.


sign

SignOperation sign(groovy.lang.Closure closure)
Creates a new sign operation using the given closure to configure it before executing it.

The project's default signatory and default signature type from the signing settings will be used to generate the signature. The returned sign operation gives access to the created signature files.

If there is no configured default signatory available (and one is not explicitly specified in this operation's configuration), the sign operation will fail.

Parameters:
closure - The configuration of the sign operation.
Returns:
The executed sign operation.


signPom

Signature signPom(MavenDeployment mavenDeployment, groovy.lang.Closure closure = null)
Signs the POM artifact for the given maven deployment.

You can use this method to sign the generated pom when publishing to a maven repository with the maven plugin.

 uploadArchives {
   repositories {
     mavenDeployer {
       beforeDeployment { MavenDeployment deployment ->
         signPom(deployment)
       }
     }
   }
 }
 

You can optionally provide a configuration closure to fine tune the sign operation for the POM.

Parameters:
mavenDeployment - The deployment to sign the POM of
closure - the configuration of the underlying sign operation for the pom (optional)
Returns:
the generated signature artifact


signing

SigningSettings signing(groovy.lang.Closure closure)
Configures the signing settings of this project.

The given closure is use to configure the SigningSettings. You can configure what information is used to sign and what will be signed.

 apply plugin: 'java'

 signing {
   sign configurations.archives
 }
 
Parameters:
closure - The closure to execute.


 

Groovy Documentation