This is an automated email from the ASF dual-hosted git repository.

matrei pushed a commit to branch post-gradle-merge
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit c0bca131c7c917ce4d857ef127344d76894e2668
Author: Mattias Reichel <[email protected]>
AuthorDate: Wed Apr 16 11:22:33 2025 +0200

    build: simplify setting of publishing credentials
---
 grails-gradle/build.gradle           | 8 ++++----
 grails-gradle/docs-core/build.gradle | 9 ++++++---
 grails-gradle/model/build.gradle     | 9 ++++++---
 grails-gradle/plugins/build.gradle   | 9 ++++++---
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/grails-gradle/build.gradle b/grails-gradle/build.gradle
index 4181057b45..9277f6d0f3 100644
--- a/grails-gradle/build.gradle
+++ b/grails-gradle/build.gradle
@@ -30,10 +30,10 @@ if (isReleaseVersion) {
     nexusPublishing {
         repositories {
             sonatype {
-                nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
-                username = System.getenv('SONATYPE_USERNAME') ?: 
project.hasProperty('sonatypeOssUsername') ? 
project.findProperty('sonatypeOssUsername') : ''
-                password = System.getenv('SONATYPE_PASSWORD') ?: 
project.hasProperty('sonatypeOssPassword') ? 
project.findProperty('sonatypeOssPassword') : ''
-                stagingProfileId = 
System.getenv('SONATYPE_STAGING_PROFILE_ID') ?: 
project.findProperty('sonatypeOssStagingProfileId') ?: ''
+                nexusUrl = uri('https://s01.oss.sonatype.org/service/local')
+                username = System.getenv('SONATYPE_USERNAME') ?: 
findProperty('sonatypeOssUsername')
+                password = System.getenv('SONATYPE_PASSWORD') ?: 
findProperty('sonatypeOssPassword')
+                stagingProfileId = 
System.getenv('SONATYPE_STAGING_PROFILE_ID') ?: 
findProperty('sonatypeOssStagingProfileId')
             }
         }
     }
diff --git a/grails-gradle/docs-core/build.gradle 
b/grails-gradle/docs-core/build.gradle
index c10c04d483..91a5a94f08 100644
--- a/grails-gradle/docs-core/build.gradle
+++ b/grails-gradle/docs-core/build.gradle
@@ -67,10 +67,13 @@ publishing {
         repositories {
             maven {
                 credentials {
-                    username = System.getenv("MAVEN_PUBLISH_USERNAME") ?: ''
-                    password = System.getenv("MAVEN_PUBLISH_PASSWORD") ?: ''
+                    username = System.getenv('MAVEN_PUBLISH_USERNAME')
+                    password = System.getenv('MAVEN_PUBLISH_PASSWORD')
                 }
-                url = System.getenv("MAVEN_PUBLISH_URL") ?: 
'https://repository.apache.org/content/repositories/snapshots'
+                url = uri(
+                        System.getenv('MAVEN_PUBLISH_URL') ?:
+                        
'https://repository.apache.org/content/repositories/snapshots'
+                )
             }
         }
     }
diff --git a/grails-gradle/model/build.gradle b/grails-gradle/model/build.gradle
index 1fe8d6f9b3..f3dd538d55 100644
--- a/grails-gradle/model/build.gradle
+++ b/grails-gradle/model/build.gradle
@@ -57,10 +57,13 @@ publishing {
         repositories {
             maven {
                 credentials {
-                    username = System.getenv("MAVEN_PUBLISH_USERNAME") ?: ''
-                    password = System.getenv("MAVEN_PUBLISH_PASSWORD") ?: ''
+                    username = System.getenv('MAVEN_PUBLISH_USERNAME')
+                    password = System.getenv('MAVEN_PUBLISH_PASSWORD')
                 }
-                url = System.getenv("MAVEN_PUBLISH_URL") ?: 
'https://repository.apache.org/content/repositories/snapshots'
+                url = uri(
+                        System.getenv('MAVEN_PUBLISH_URL') ?:
+                        
'https://repository.apache.org/content/repositories/snapshots'
+                )
             }
         }
     }
diff --git a/grails-gradle/plugins/build.gradle 
b/grails-gradle/plugins/build.gradle
index 1e0b488936..fcee53db69 100644
--- a/grails-gradle/plugins/build.gradle
+++ b/grails-gradle/plugins/build.gradle
@@ -102,10 +102,13 @@ publishing {
         repositories {
             maven {
                 credentials {
-                    username = System.getenv("MAVEN_PUBLISH_USERNAME") ?: ''
-                    password = System.getenv("MAVEN_PUBLISH_PASSWORD") ?: ''
+                    username = System.getenv('MAVEN_PUBLISH_USERNAME')
+                    password = System.getenv('MAVEN_PUBLISH_PASSWORD')
                 }
-                url = System.getenv("MAVEN_PUBLISH_URL") ?: 
'https://repository.apache.org/content/repositories/snapshots'
+                url = uri(
+                        System.getenv('MAVEN_PUBLISH_URL') ?:
+                        
'https://repository.apache.org/content/repositories/snapshots'
+                )
             }
         }
     }

Reply via email to