@@ -11,6 +11,57 @@ publishing {
1111 }
1212 }
1313 from components. java
14+
15+ pom {
16+ name = " My Plugin"
17+ description = " My first plugin"
18+ url = ' https://github.com/grace-plugins/my-plugin'
19+ licenses {
20+ license {
21+ name = ' The Apache License, Version 2.0'
22+ url = ' https://www.apache.org/licenses/LICENSE-2.0.txt'
23+ }
24+ }
25+ developers {
26+ developer {
27+ id = ' yourname'
28+ name = ' Your Name'
29+ 30+ }
31+ }
32+ scm {
33+ connection = ' scm:git:git://github.com/grace-plugins/my-plugin.git'
34+ developerConnection = ' scm:git:ssh://github.com:grace-plugins/my-plugin.git'
35+ url = ' https://github.com/grace-plugins/my-plugin'
36+ }
37+ }
1438 }
1539 }
1640}
41+
42+ ext. " signing.keyId" = project. hasProperty(" signing.keyId" ) ? project. getProperty(' signing.keyId' ) : System . getenv(' SIGNING_KEY' )
43+ ext. " signing.password" = project. hasProperty(" signing.password" ) ? project. getProperty(' signing.password' ) : System . getenv(' SIGNING_PASSPHRASE' )
44+ ext. " signing.secretKeyRingFile" = project. hasProperty(" signing.secretKeyRingFile" ) ? project. getProperty(' signing.secretKeyRingFile' ) : (" ${ System.properties['user.home']}${ File.separator} .gnupg${ File.separator} secring.gpg" )
45+ ext. isReleaseVersion = ! projectVersion. endsWith(" SNAPSHOT" )
46+
47+ nexusPublishing {
48+ repositories {
49+ sonatype {
50+ def ossUser = System . getenv(" SONATYPE_USERNAME" ) ?: project. hasProperty(" sonatypeOssUsername" ) ? project. sonatypeOssUsername : ' '
51+ def ossPass = System . getenv(" SONATYPE_PASSWORD" ) ?: project. hasProperty(" sonatypeOssPassword" ) ? project. sonatypeOssPassword : ' '
52+ def ossStagingProfileId = System . getenv(" SONATYPE_STAGING_PROFILE_ID" ) ?: project. hasProperty(" sonatypeOssStagingProfileId" ) ? project. sonatypeOssStagingProfileId : ' '
53+ nexusUrl = uri(" https://s01.oss.sonatype.org/service/local/" )
54+ snapshotRepositoryUrl = uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
55+ username = ossUser
56+ password = ossPass
57+ stagingProfileId = ossStagingProfileId
58+ }
59+ }
60+ }
61+
62+ afterEvaluate {
63+ signing {
64+ required { isReleaseVersion && gradle. taskGraph. hasTask(" publish" ) }
65+ sign publishing. publications. maven
66+ }
67+ }
0 commit comments