Gradle 2.x no longer supports embedding username and password in maven url

Gradle’s maven syntax used to support embedding the username and password in the url. For example,

maven {
     url "https://${GITHUB_USERNAME}:${GITHUB_PASSWORD}"

Doing it this way, while ugly, is a necessary workaround when dealing with certain kinds of private maven repos (see GRADLE-3091). It worked well enough in 1.x, but now in 2.x it seems to be silently dropping this information, breaking support for these private maven repos.

I want to emphasize that this workaround is gross-- fixing GRADLE-3091 is a much better way to go about it. However, GRADLE-3091 has been open for 9 months and has still not been addressed. And now in 2.x we can’t even use the workaround.

What about using $HOME/.gradle/ to store username and password pairs?



uploadArchives {
    repositories {
      mavenDeployer {
        repository(url: project.ext.myrepoInternal) {
          authentication(userName: myrepoUserName, password: myrepoPassword)
        pom.version = version
        pom.groupId =
        pom.artifactId =


task ftp << {
    ant {
      taskdef(name: 'ftp',
              classname: '',
              classpath: configurations.ftpAntTask.asPath)
      ftp(server: "", userid: ftpUserName, password: ftpPassword) {
          fileset(dir: "htdocs/manual")