Skip to content

Commit eab2be3

Browse files
committed
attempt to catch missing property values
1 parent e0f96c8 commit eab2be3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,16 @@ uploadArchives {
6565
mavenDeployer {
6666
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
6767

68-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
69-
authentication(userName: ossrhUsername, password: ossrhPassword)
70-
}
68+
if (hasProperty('ossrhUsername') && hasProperty('ossrhPassword')) {
69+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
70+
authentication(userName: ossrhUsername, password: ossrhPassword)
71+
}
7172

72-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
73-
authentication(userName: ossrhUsername, password: ossrhPassword)
73+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
74+
authentication(userName: ossrhUsername, password: ossrhPassword)
75+
}
7476
}
75-
77+
7678
pom.project {
7779
name 'Java Hamcrest'
7880
packaging 'jar'

0 commit comments

Comments
 (0)