Skip to content

Commit 57bed7c

Browse files
authored
Read sonatype credentials from env (#64)
Read properties as default but if missing, try env. Nice for local and CI.
1 parent 9649807 commit 57bed7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ publishing {
110110
maven {
111111
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
112112
credentials {
113-
username = sonatypeUsername
114-
password = sonatypePassword
113+
username = hasProperty('sonatypeUsername') ? sonatypeUsername : System.getenv('sonatypeUsername')
114+
password = hasProperty('sonatypePassword') ? sonatypePassword : System.getenv('sonatypePassword')
115115
}
116116
}
117117
}

0 commit comments

Comments
 (0)