apply plugin: 'java'
apply plugin: 'maven'

// START SNIPPET use-plugin
apply plugin: 'signing'
// END SNIPPET use-plugin

group = 'gradle'
version = '1.0'

// Typically set in ~/.gradle/gradle.properties
project['signing.keyId'] = "24875D73"
project['signing.password'] = "gradle"
project['signing.secretKeyRingFile'] = file("secKeyRingFile.gpg").absolutePath

// START SNIPPET sign-archives
signing {
    sign configurations.archives
}
// END SNIPPET sign-archives

// START SNIPPET sign-pom
uploadArchives {
    repositories {
        mavenDeployer {
// END SNIPPET sign-pom
            repository(url: uri("${buildDir}/repo"))
// START SNIPPET sign-pom
            beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
        }
    }
}
// END SNIPPET sign-pom