Skip to content

Commit

Permalink
added default for sonatype credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-num committed Mar 19, 2019
1 parent dfbab5f commit a2cd645
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sourceCompatibility = 1.7
group = "uk.modl"
applicationName = "java-interpreter"
archivesBaseName = "java-interpreter"
version = "0.0.3-SNAPSHOT"
version = "0.0.3"

def isSnapshot = version.endsWith("SNAPSHOT")

Expand Down Expand Up @@ -101,9 +101,28 @@ publishing {
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
if(!isSnapshot) {
def stUser
def stPwd

if (project.hasProperty('sonatypeUsername')) {
stUser = sonatypeUsername
}
else{
stUser = "notdefined"
logger.warn("sonatypeUsername not defined. Please update your gradle config file")
}

if (project.hasProperty('sonatypePassword')) {
stPwd = sonatypePassword
}
else{
stPwd = "notdefined"
logger.warn("sonatypePassword not defined. Please update your gradle config file")
}

credentials {
username sonatypeUsername
password sonatypePassword
username stUser
password stPwd
}
}
}
Expand Down

0 comments on commit a2cd645

Please sign in to comment.