@@ -180,10 +180,10 @@ subprojects {
180180 }
181181
182182 bintray {
183- Properties properties = new Properties ()
184- properties . load(project . rootProject . file( ' local.properties ' ) . newDataInputStream())
185- user = properties . getProperty (" bintray.user" )
186- key = properties . getProperty (" bintray.apikey" )
183+ // You should configure "bintray.user" and "bintray.apiKey" in the gradle.properties
184+ // that in gradle cache directory
185+ user = safeGetProperty (" bintray.user" )
186+ key = safeGetProperty (" bintray.apikey" )
187187
188188 publications = [' mavenJava' ]
189189 publish = true // 是否发布
@@ -202,14 +202,13 @@ subprojects {
202202 desc = project. pomDescription
203203 gpg {
204204 sign = false // 是否GPG签名,可使用Gpg4win创建密钥文件
205- passphrase = properties . getProperty( " bintray.gpg.password " )
206- // GPG签名所用密钥
205+ // GPG签名所用密钥
206+ passphrase = safeGetProperty( " bintray.gpg.password " )
207207 }
208208 mavenCentralSync {
209209 sync = false // 是否同步到Maven Central
210- user = properties. getProperty(" sonatype.user" ) // sonatype用户名
211- password = properties. getProperty(" sonatype.password" )
212- // sonatype密码
210+ user = safeGetProperty(" sonatype.user" ) // sonatype用户名
211+ password = safeGetProperty(" sonatype.password" ) // sonatype密码
213212 close = ' 1'
214213 }
215214 }
@@ -221,3 +220,7 @@ subprojects {
221220 }
222221}
223222
223+ String safeGetProperty (String key ) {
224+ hasProperty(" key" ) ? getProperty(" key" ) : " "
225+ }
226+
0 commit comments