File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -156,8 +156,8 @@ publishing {
156156 maven {
157157 url ' https://repo.nos.to/content/repositories/NostoDependencies/'
158158 credentials {
159- username = " $ mavenUser "
160- password = " $ mavenPassword "
159+ username = project . hasProperty( ' mavenUser' ) ? project . mavenUser : " "
160+ password = project . hasProperty( ' mavenPassword' ) ? project . mavenPassword : " "
161161 }
162162 }
163163 }
@@ -166,6 +166,14 @@ publishing {
166166tasks. register(' publishToNostoRepo' ) {
167167 dependsOn ' publishMavenPublicationToMavenRepository'
168168}
169+ gradle. taskGraph. whenReady { taskGraph ->
170+ if (taskGraph. hasTask(' :publishToNostoRepo' )) {
171+ if (! project. hasProperty(' mavenUser' ) || ! project. hasProperty(' mavenPassword' )) {
172+ throw new GradleException (" mavenUser and mavenPassword must be defined for publishToNostoRepo task" )
173+ }
174+ }
175+ }
176+
169177
170178afterReleaseBuild. dependsOn nexusPublishing
171179
You can’t perform that action at this time.
0 commit comments