File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -140,8 +140,14 @@ publishing {
140
140
name = " MavenCentralSnapshot"
141
141
url = uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
142
142
credentials {
143
- username = providers.gradleProperty(" ossrhUsername" ).get()
144
- password = providers.gradleProperty(" ossrhPassword" ).get()
143
+ run {
144
+ if (gradle.startParameter.taskNames.find { it.contains(" ToMavenCentralSnapshotRepository" ) } != null ) {
145
+ if (! providers.gradleProperty(" ossrhUsername" ).isPresent) logger.error(" ossrhUsername not set" )
146
+ if (! providers.gradleProperty(" ossrhPassword" ).isPresent) logger.error(" ossrhPassword not set" )
147
+ }
148
+ }
149
+ username = providers.gradleProperty(" ossrhUsername" ).orNull
150
+ password = providers.gradleProperty(" ossrhPassword" ).orNull
145
151
}
146
152
}
147
153
}
You can’t perform that action at this time.
0 commit comments