api / org.gradle.plugins.signing / SigningExtension / signPom

signPom

open fun signPom(mavenDeployment: MavenDeployment, closure: Closure<Any>): Signature

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 -> signing.signPom(deployment) } } } } 

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

If #isRequired() is false and the signature cannot be generated (e.g. no configured signatory), this method will silently do nothing. That is, a signature for the POM file will not be uploaded.

Note: Signing the generated POM file generated by the Maven Publishing plugin is currently not supported. Future versions of Gradle might add this functionality.

Parameters

mavenDeployment - The deployment to sign the POM of

closure - the configuration of the underlying SignOperation for the POM (optional)

Return
the generated signature artifact

open fun signPom(mavenDeployment: MavenDeployment): Signature

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 -> signing.signPom(deployment) } } } } 

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

If #isRequired() is false and the signature cannot be generated (e.g. no configured signatory), this method will silently do nothing. That is, a signature for the POM file will not be uploaded.

Note: Signing the generated POM file generated by the Maven Publishing plugin is currently not supported. Future versions of Gradle might add this functionality.

Parameters

mavenDeployment - The deployment to sign the POM of

Return
the generated signature artifact