@@ -2,11 +2,11 @@ apply plugin: 'java'
22apply plugin : ' maven'
33apply plugin : ' signing'
44
5- final String groupId = ' io.ably'
6- final String artifactId = ' ably-java'
7- final String localReleaseDest = " ${ buildDir} /release/${ version} "
8- final String mavenUser = hasProperty(' ossrhUsername' ) ? ossrhUsername : ' '
9- final String mavenPassword = hasProperty(' ossrhPassword' ) ? ossrhPassword : ' '
5+ final String GROUP_ID = ' io.ably'
6+ final String ARTIFACT_ID = ' ably-java'
7+ final String LOCAL_RELEASE_DESTINATION = " ${ buildDir} /release/${ version} "
8+ final String MAVEN_USER = hasProperty(' ossrhUsername' ) ? ossrhUsername : ' '
9+ final String MAVEN_PASSWORD = hasProperty(' ossrhPassword' ) ? ossrhPassword : ' '
1010
1111/*
1212 * Task which signs and uploads the Java artifacts to Nexus OSSRH.
@@ -16,20 +16,20 @@ uploadArchives {
1616 sign configurations. archives
1717 }
1818 repositories. mavenDeployer {
19- logger. lifecycle(' OSSRH auth with username: ' + mavenUser )
19+ logger. lifecycle(' OSSRH auth with username: ' + MAVEN_USER )
2020
2121 beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
2222
2323 repository(url : ' https://oss.sonatype.org/service/local/staging/deploy/maven2/' ) {
24- authentication(userName : mavenUser , password : mavenPassword )
24+ authentication(userName : MAVEN_USER , password : MAVEN_PASSWORD )
2525 }
2626
2727 snapshotRepository(url : ' https://oss.sonatype.org/content/repositories/snapshots/' ) {
28- authentication(userName : mavenUser , password : mavenPassword )
28+ authentication(userName : MAVEN_USER , password : MAVEN_PASSWORD )
2929 }
3030
31- pom. groupId = groupId
32- pom. artifactId = artifactId
31+ pom. groupId = GROUP_ID
32+ pom. artifactId = ARTIFACT_ID
3333 pom. version = version
3434
3535 // Add other pom properties here if you want (developer details / licenses)
@@ -79,19 +79,19 @@ uploadArchives {
7979 // Export files to local storage
8080 // COMMENT OUT THIS LINE IN ORDER TO RELEASE TO SONATYPE NEXUS STAGING
8181 // TODO https://github.com/ably/ably-java/issues/566
82- repository(url : " file://${ localReleaseDest } " )
82+ repository(url : " file://${ LOCAL_RELEASE_DESTINATION } " )
8383 }
8484}
8585
8686task zipRelease (type : Zip ) {
87- from localReleaseDest
87+ from LOCAL_RELEASE_DESTINATION
8888 destinationDir buildDir
8989 archiveName " release-${ version} .zip"
9090}
9191
9292task assembleRelease {
9393 doLast {
94- logger. quiet(" Release ${ version} can be found at ${ localReleaseDest } " )
94+ logger. quiet(" Release ${ version} can be found at ${ LOCAL_RELEASE_DESTINATION } " )
9595 logger. quiet(" Release ${ version} zipped can be found ${ buildDir} /release-${ version} .zip" )
9696 }
9797 dependsOn(uploadArchives)
0 commit comments