title: Can't connect to my nexus repository by using gradle
body: <p>I've got following build.gradle file: </p>
  
  <pre><code>apply plugin: 'maven'
  apply plugin: 'java'
  apply plugin: 'eclipse'
  buildscript {
  
  repositories {
      maven {
        url "&lt;myURL&gt;/nexus/content/groups/public"
     }
  }
      dependencies {
  
      }
  }
  
  
  jar {
     baseName = 'myAppName'
     version = '0.0.1-SNAPSHOT'
  }
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  repositories {
  
  maven {
        url "&lt;myURL&gt;/nexus/content/groups/public/"
        credentials {
          username "nexusUser"
          password "nexusPassword"
      }
  }
  maven {
        url "&lt;myURL&gt;/nexus/content/repositories/snapshots"
        credentials {
          username "nexusUser"
          password "nexusPassword"
      }
  }
  }
  dependencies {
  
  compile group: 'javax', name: 'javaee-api', version: '7.0'
  compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.5'
  compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
  testCompile 'junit:junit:4.12'
  testCompile 'org.mockito:mockito-all:1.10.19'
  }
  
  uploadArchives {
  
  repositories {
     mavenDeployer {
           repository(url: "&lt;myURL&gt;/content/repositories/releases") {
              authentication(userName: nexusUsername, password: nexusPassword)
            }
           snapshotRepository(url: "&lt;myURL&gt;/nexus/content/repositories/snapshots") {
           authentication(userName: nexusUsername, password: nexusPassword)
      }
  
           pom.version = "0.0.1-SNAPSHOT"
           pom.artifactId = "app-name-commons"
           pom.groupId = "de.commons"
     }
  }
  }
  </code></pre>
  
  <p>My Problem is that I can't neither upload artifacts to my nexus repo nore I get the dependencies like javaee-api etc. The credential are defined in a gradle.properties file. Has anybody a hint why this doesn't work?  </p>
  
  <p><strong>Update</strong></p>
  
  <p>If I make the repositories readable for anonymous users i get the dependencies. So it seems the problem is the login.</p>