[GRADLE-1971] 1.0-milestone-6 cannot contact Maven Central when using a proxy Created: 29/Nov/11  Updated: 04/Jan/13  Resolved: 30/Nov/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-5
Fix Version/s: 1.0-milestone-7

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 0

Issue Links:
Duplicate
Duplicates GRADLE-2003 With transition to httpclient library... Resolved

 Description   

There seems to be an issue with using a proxy in milestone-6. If I try to run the java/onlyif sample using the following settings in gradle.properties

systemProp.http.proxyHost=co.proxy.myCompany.com
systemProp.http.proxyPort=8000

It works in milestone-5, but fails in milestone-6 with a connect issue as shown here below. Note, that I am running the same 1.0-milestone-5 sample, just with the milestone-6 gradle version...



 Comments   
Comment by Gradle Forums [ 29/Nov/11 ]

same problem, with milestone 6 the proxy setting stopped working

Comment by Gradle Forums [ 29/Nov/11 ]

In Milestone 6 we switched to use Commons HTTP Client to download artifacts (away from using regular java.net.URL). This allows us to do much better things with authentication, but unfortunately doesn't support standard java proxy settings out of the box.

I'll raise this as a bug, and we'll make sure this is fixes for 1.0.
Thanks for the report.

Comment by Daz DeBoer [ 30/Nov/11 ]

C:\PROGRA~1\gradle-1.0-milestone-5\samples\java\onlyif>gradle -version

------------------------------------------------------------
Gradle 1.0-milestone-6
------------------------------------------------------------

Gradle build time: Thursday, November 17, 2011 5:54:12 AM UTC
Groovy: 1.8.4
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_23 (Sun Microsystems Inc. 19.0-b09)
OS: Windows XP 5.1 x86

C:\PROGRA~1\gradle-1.0-milestone-5\samples\java\onlyif>gradle build --stacktrace

:compileJava
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve group:junit, module:junit, version:4.8.2.
    Required by:
    :onlyif:unspecified
    Cause: java.lang.reflect.UndeclaredThrowableException (no error message)
  • Try:
    Run with --info or --debug option to get more log output.
  • Exception is:
    org.gradle.api.internal.artifacts.ivyservice.ModuleVersionResolveException: Coul
    d not resolve group:junit, module:junit, version:4.8.2.
    Required by:
    :onlyif:unspecified
    at org.gradle.api.internal.artifacts.ivyservice.IvyResolverBackedDepende
    ncyToModuleResolver$DefaultModuleVersionResolver.getDescriptor(IvyResolverBacked
    DependencyToModuleResolver.java:82)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.Dependency
    GraphBuilder$ModuleVersionSelectorResolveState.resolve(DependencyGraphBuilder.ja
    va:559)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.Dependency
    GraphBuilder$DependencyResolvePath.resolveMetaData(DependencyGraphBuilder.java:6
    49)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.Dependency
    GraphBuilder.traverseGraph(DependencyGraphBuilder.java:130)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.Dependency
    GraphBuilder.resolve(DependencyGraphBuilder.java:58)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDep
    endencyResolver.resolve(DefaultDependencyResolver.java:69)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDepe
    ndencyResolver$1.call(CacheLockingArtifactDependencyResolver.java:37)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDepe
    ndencyResolver$1.call(CacheLockingArtifactDependencyResolver.java:35)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManag
    er.withCacheLock(DefaultCacheLockingManager.java:54)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDepe
    ndencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:35)
    at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyR
    esolver.resolve(SelfResolvingDependencyResolver.java:42)
    at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigs
    ArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyRes
    olver.java:78)
    at org.gradle.api.internal.artifacts.ivyservice.EventBroadcastingArtifac
    tDependencyResolver.resolve(EventBroadcastingArtifactDependencyResolver.java:37)

at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDep
endencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:36)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
.getResolvedConfiguration(DefaultConfiguration.java:234)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
_Decorated.getResolvedConfiguration(Unknown Source)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:493)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
.getFiles(DefaultConfiguration.java:204)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration
_Decorated.getFiles(Unknown Source)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:1
87)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context.doResolve(DefaultFileCollectionResolveContext.java:102)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:74)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:1
78)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context.doResolve(DefaultFileCollectionResolveContext.java:97)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:74)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:1
78)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context.doResolve(DefaultFileCollectionResolveContext.java:97)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolve
Context.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:74)
at org.gradle.api.internal.file.CompositeFileCollection$1.resolve(Compos
iteFileCollection.java:88)
at org.gradle.api.internal.file.CompositeFileCollection.getSourceCollect
ions(CompositeFileCollection.java:143)
at org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(C
ompositeFileTree.java:30)
at org.gradle.api.internal.file.CompositeFileCollection.getFiles(Composi
teFileCollection.java:38)
at org.gradle.api.internal.file.AbstractFileCollection.iterator(Abstract
FileCollection.java:60)
at org.gradle.api.internal.changedetection.DefaultFileSnapshotter.snapsh
ot(DefaultFileSnapshotter.java:42)
at org.gradle.api.internal.changedetection.InputFilesChangedUpToDateRule
.create(InputFilesChangedUpToDateRule.java:35)
at org.gradle.api.internal.changedetection.CompositeUpToDateRule.create(
CompositeUpToDateRule.java:35)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepos
itory$HistoricExecution.calcCurrentState(DefaultTaskArtifactStateRepository.java
:80)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepos
itory$HistoricExecution.isUpToDate(DefaultTaskArtifactStateRepository.java:88)
at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepos
itory$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:1
28)
at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactState
Repository$ShortCircuitArtifactState.isUpToDate(ShortCircuitTaskArtifactStateRep
ository.java:77)
at org.gradle.api.internal.changedetection.FileCacheBroadcastTaskArtifac
tStateRepository$1.isUpToDate(FileCacheBroadcastTaskArtifactStateRepository.java
:37)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.exec
ute(SkipUpToDateTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execut
e(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecu
ter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter
.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execut
e(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter
.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailur
e(AbstractTask.java:243)
at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTask
GraphExecuter.java:192)
at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGr
aphExecuter.java:177)
at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGrap
hExecuter.java:83)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTask
ExecutionAction.java:36)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
r.java:70)
at org.gradle.execution.DefaultBuildExecuter.access$300(DefaultBuildExec
uter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecu
ter.java:80)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildEx
ecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
r.java:70)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
r.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
GradleLauncher.java:157)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
Launcher.java:112)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
cher.java:80)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42
)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28
)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionRe
portingAction.java:32)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionRe
portingAction.java:21)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.ex
ecute(CommandLineActionFactory.java:233)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.ex
ecute(CommandLineActionFactory.java:217)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)
at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)
at org.gradle.launcher.exec.Execution.execute(Execution.java:28)
at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:
51)
at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)
at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy32.exists(Unknown Source)
at org.apache.ivy.plugins.resolver.RepositoryResolver.findResourceUsingP
attern(RepositoryResolver.java:97)
at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findRes
ourceUsingPatterns(AbstractPatternsBasedResolver.java:93)
at org.apache.ivy.plugins.resolver.IBiblioResolver.findIvyFileRef(IBibli
oResolver.java:102)
at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicReso
lver.java:223)
at org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblio
Resolver.java:503)
at org.gradle.api.internal.artifacts.repositories.MavenResolver.getDepen
dency(MavenResolver.java:50)
at org.gradle.api.internal.artifacts.ivyservice.UserResolverChain$Module
Resolution.resolveModule(UserResolverChain.java:326)
at org.gradle.api.internal.artifacts.ivyservice.UserResolverChain.resolv
eLatestModule(UserResolverChain.java:110)
at org.gradle.api.internal.artifacts.ivyservice.UserResolverChain.getDep
endency(UserResolverChain.java:74)
at org.gradle.api.internal.artifacts.ivyservice.TopLeveResolverChain.get
Dependency(TopLeveResolverChain.java:60)
at org.gradle.api.internal.artifacts.ivyservice.IvyResolverBackedDepende
ncyToModuleResolver$DefaultModuleVersionResolver.getDescriptor(IvyResolverBacked
DependencyToModuleResolver.java:79)
... 75 more
Caused by: java.net.ConnectException: Connection timed out: connect
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.c
reateSocket(DefaultProtocolSocketFactory.java:80)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.c
reateSocket(DefaultProtocolSocketFactory.java:122)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java
:707)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Htt
pMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe
thodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:323)
at org.gradle.api.internal.artifacts.repositories.CommonsHttpClientBacke
dRepository$LazyResourceInvocationHandler.init(CommonsHttpClientBackedRepository
.java:186)
at org.gradle.api.internal.artifacts.repositories.CommonsHttpClientBacke
dRepository$LazyResourceInvocationHandler.invoke(CommonsHttpClientBackedReposito
ry.java:179)
... 87 more

BUILD FAILED

Total time: 23.719 secs

C:\PROGRA~1\gradle-1.0-milestone-5\samples\java\onlyif>

Generated at Wed Jun 30 12:09:18 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.