When authenticating with maven repos defined in uploadArchive, read existing settings.xml

(John Ruiz) #1

You should allow me to configure gradle to read my existing settings.xml for username/password credentials when configuring uploadArchives.

This would allow me to avoid putting credentials into my source repository.

Something like this:

uploadArchives {
        repositories {
            mavenDeployer {
                repository(url: "http://nexus.example.com/content/repositories/snapshots/") {
                    authentication(mavenSettings: "~/.m2/settings.xml")
                    // or re-use your gradle.properties!
                    authentication(gradleProperties: "~/.gradle/gradle.properties")
                pom.project {
                    licenses {
                        license {
                            name 'The Apache Software License, Version 2.0'
                            url 'http://www.apache.org/licenses/LICENSE-2.0.txt'

(Benjamin Muschko) #2

This functionality is not supported out-of-the-box at the moment. You can track GRADLE-2365 or some other the related JIRA tickets. However, it’s fairly easy to read credentials from your Maven settings file and use it for publishing. Here’s some example code.