File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -232,22 +232,28 @@ if (project.hasProperty("signing.keyId") && project.hasProperty("signing.passwor
232232 }
233233}
234234
235+ if (project. hasProperty(" sonatype_username" ) && project. hasProperty(" sonatype_password" ))
236+ {
235237// Plugin that uses the New Maven Central Publishing (NMCP) API to publish Maven artifacts. https://github.com/GradleUp/nmcp
236- nmcp {
237- centralPortal {
238- username = sonatype_username
239- password = sonatype_password
240- // publish manually from the portal
241- publishingType = " USER_MANAGED"
238+ nmcp {
239+ centralPortal {
240+ username = sonatype_username
241+ password = sonatype_password
242+ // publish manually from the portal
243+ publishingType = " USER_MANAGED"
242244// // or if you want to publish automatically
243245// publishingType = "AUTOMATIC"
246+ }
244247 }
245248}
246249
247250project. tasks. register(' publishRelease' , DefaultTask ) {
248251 DefaultTask task ->
249252 task. group = ' Publishing'
250253 task. description = ' Publish to Local repository and Maven Central'
251- task. dependsOn(tasks. publish, tasks. publishLibsPublicationToCentralPortal)
254+ if (project. hasProperty(" artifactory_user" ) && project. hasProperty(" artifactory_password" ))
255+ task. dependsOn(tasks. publish)
256+ if (project. hasProperty(" sonatype_username" ) && project. hasProperty(" sonatype_password" ))
257+ task. dependsOn(tasks. publishLibsPublicationToCentralPortal)
252258}
253259
You can’t perform that action at this time.
0 commit comments