Skip to content

Commit

Permalink
Handle unavailable sonatype properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Ryan committed Apr 8, 2013
1 parent 9de5614 commit d0e42e3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gradle/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ task uploadMavenCentral(type:Upload, dependsOn: signArchives) {
// To test deployment locally, use the following instead of oss.sonatype.org
//repository(url: "file://localhost/${rootProject.rootDir}/repo")

def sonatypeUsername = rootProject.hasProperty('sonatypeUsername')?rootProject.sonatypeUsername:''
def sonatypePassword = rootProject.hasProperty('sonatypePassword')?rootProject.sonatypePassword:''

repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword)
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword)
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

// Prevent datastamp from being appending to artifacts during deployment
Expand Down

0 comments on commit d0e42e3

Please sign in to comment.