Download artifacts from Nexus with credentials : Gradle don't use basic authentication


(fares.hassak) #1

Here my configuration :

repositories {

maven {

credentials {

username mavenUser

password mavenPassword

}

url “http://localhost:8080/content/groups/public/

} }

Gradle don’t use Basic authentication :

GET /content/groups/public/commons-lang/commons-lang/2.3/commons-lang-2.3.pom HTTP/1.1 > >> Accept-Encoding: gzip,deflate > >> Host: localhost > >> Connection: Keep-Alive > >> User-Agent: Gradle/1.6 (Windows 7;6.1;x86) (Sun Microsystems Inc.;1.6.0_19;16.2-b04)

<< HTTP/1.1 401 Unauthorized > << Date: Mon, 15 Jul 2013 09:12:51 GMT > << WWW-Authenticate: Basic > << Content-Type: text/html;charset=ISO-8859-1 > << Cache-Control: must-revalidate,no-cache,no-store > << Content-Length: 1448 > << Server: Jetty(7.5.4.v20111024)

And with curl , it’s working fine :

curl -v -u user:password http://localhost:8080/content/groups/public/commons-lang/commons-lang/2.3/commons-lang-2.3.pom

GET /content/groups/public/commons-lang/commons-lang/2.3/commons-lang-2.3.pom HTTP/1.1 > > Authorization: Basic dmFzOnZhc25leHVz > > User-Agent: curl/7.31.0 > > Host: localhost > > Accept: /

< HTTP/1.1 200 OK > < Date: Tue, 16 Jul 2013 13:34:21 GMT > < Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Mon, 15-Jul-2013 13:34:21 GMT > < Content-Type: application/xml > < Last-Modified: Tue, 13 Feb 2007 18:32:02 GMT > < ETag: “{SHA1{13187624e6fc84efe123c5ab36f8ade0e2bcea2c}}” > < Date: Tue, 16 Jul 2013 13:34:21 GMT > < Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept > * Server Noelios-Restlet-Engine/1.1.6-SONATYPE-5348-V4 is not blacklisted > < Server: Noelios-Restlet-Engine/1.1.6-SONATYPE-5348-V4 > < Content-Length: 11115