Hi all,

I've defined my maven repository username, password etc in my
~/.gradle/gradle.properties and all is fine on my machine, but I have to
comment it out before checking in as the build will fail on other machines.


I've tried using hasProperty('MAVEN_REPOSITORY_USERNAME') as per the
following but it the upload archives task doesn't work on my machine.

  if (hasProperty('MAVEN_REPOSITORY_URL')) {
    uploadArchives {
      repositories.mavenDeployer {
        name = 'ftpDeployer'
        // use the configuration we created earlier...
        configuration = configurations.mavenDeployerJars

        repository(url: MAVEN_REPOSITORY_URL) {
          authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD)
        }

        snapshotRepository(url: MAVEN_SNAPSHOT_URL) {
          authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD)
        }
      }
    }

Is this the correct approach or is there a better way?

Cheers
Andrew

Reply via email to