Gradle 2.0 - POM relocation against authenticated server requests Jar


(John Engelman) #1

Trying to upgrade our build from Gradle 1.9 to 2.0 and I’ve encountered an error where a POM w/ relocation (jdom:jdom:1.1) issues a HEAD request for the Jar artifact at those coordinates. Is this expected?

The issue I’m having is that we are running against an authenticated Artifactory server and this requests returns a 401 Unauthorized which kills the build.

This is the closest things I’ve found: http://issues.gradle.org/browse/GRADLE-3041


(John Engelman) #2

according to my artifactory logs, Gradle is issuing the HEAD request without auth.


(John Engelman) #3

Here is the stack trace

Caused by: org.gradle.api.UncheckedIOException: Could not HEAD ‘http://artifactory.moolb.com/artifactory/repo/jdom/jdom/1.1/jdom-1.1.jar’. Received status code 401 from server: Unauthorized

at org.gradle.internal.resource.transport.http.HttpClientHelper.processResponse(HttpClientHelper.java:121)

at org.gradle.internal.resource.transport.http.HttpClientHelper.performHead(HttpClientHelper.java:62)

at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getMetaData(HttpResourceAccessor.java:87)

at org.gradle.internal.resource.transport.DefaultExternalResourceRepository.getResourceMetaData(DefaultExternalResourceRepository.java:60)

at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.staticResourceExists(DefaultExternalResourceArtifactResolver.java:74)

at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.artifactExists(DefaultExternalResourceArtifactResolver.java:65)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.findOptionalArtifacts(ExternalResourceResolver.java:232)

at org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver$MavenRemoteRepositoryAccess.resolveConfigurationArtifacts(MavenResolver.java:211)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$AbstractRepositoryAccess.resolveModuleArtifacts(ExternalResourceResolver.java:360)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveModuleArtifacts(ExternalResourceResolver.java:407)

at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CacheLockReleasingModuleComponentsRepository$LockReleasingRepositoryAccess$4.run(CacheLockReleasingModuleComponentsRepository.java:79)


(John Engelman) #4

Nevermind, this was a misconfiguration in our build where an artifact moved from an unauthenticated realm to an authenticated realm.