title: Gradle fails to download artifacts from Nexus maven repository - 401 Authorization required
body: <p>I've configured gradle build to use our company's nexus repo but maven does not seem to be able to authorized correctly - I keep getting erros such as </p>
  
  <pre><code>Failed to get resource: HEAD. [HTTP HTTP/1.1 401 Authorization Required:    https://maven.gooddata.com/nexus/content/repositories/gooddata/org/codehaus/groovy/groovy-all/2.0.4/groovy-all-2.0.4.pom]
  </code></pre>
  
  <p>Strangely enough, the deploying to the same nexus repo (via mavenDeployer) is working seamlessly.</p>
  
  <p>Below is part of my build script related to the maven repo configuration (maven_user and maven_password are defined in ~/.gradle/gradle.properties).</p>
  
  <pre><code>apply plugin: 'maven'
  
  ext {
      repos = [
              my : "&lt;my_repo_url&gt;",
              my_snapshot : "&lt;my_snapshots_repo_url&gt;"
      ]
  
  }
  
  
  repositories {
      mavenLocal()
  
      maven {
          url repos.my
          credentials {
              username = maven_user
              password = maven_password
          }
      }
      maven {
          url repos.my_snapshot
          credentials {
              userName = maven_user
              password = maven_password
          }
      }
  
      mavenCentral()
      maven { url "http://repository.codehaus.org/" }
      maven { url "http://sardine.googlecode.com/svn/maven" }
      maven { url "http://snapshots.repository.codehaus.org" }
  
  }
  
  
  uploadArchives {
      repositories.mavenDeployer {
          repository(url : repos.my) {
              authentication(userName : maven_user, password : maven_password)
          }
          snapshotRepository(url : repos.my_snapshot) {
              authentication(userName : maven_user, password : maven_password)
          }
      }
  }
  </code></pre>
  
  <p>Any suggestions what's going on?</p>