【问题标题】:IntelliJ HTTP-Proxy works but fails at gradle dependenciesIntelliJ HTTP-Proxy 工作但在 gradle 依赖项中失败
【发布时间】:2016-10-08 19:47:07
【问题描述】:

所以目前在工作中我面临一个问题,即我无法构建使用全局依赖项的项目。我们使用自动配置代理脚本,我已经在 File->Settings->Appearance & Behaviour->System Settings->HTTP Proxy 中设置并使用 Check Connection-function 进行了测试。

检查连接功能适用于任意 html 以及所需的 gradle 文件 (jcenter.bintray.com/com/android/tools/build/gradle/2.0.0/gradle-2.1.0-javadoc。罐子)。

对于我已经尝试过的解决方案:

  • 将代理信息设置到 gradle.properties 中
  • 试图设置 http 和/或 https 代理设置

    * systemProp.http(s).proxyHost=linktoproxyconfig.org  
    * systemProp.http(s).proxyPort=xxxx                 
    * systemProp.http(s).proxyUser=xxxx            
    * systemProp.http(s).proxyPassword=xxxx
    
  • 更改存储库方向(jcenter() 与 jcenter{url http://jcenter.bintray.com}

我知道这样一个事实,即可以离线工作,在本地下载 gradle。但是为了防止对不同机器上的 gradle 版本进行额外维护,我想限制脱机工作选项。

编辑:也许我还应该添加错误消息:
Gradle sync failed: Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.

如果有人对解决方案有想法,我将不胜感激。

【问题讨论】:

标签: intellij-idea gradle proxy windows-7


【解决方案1】:

IntelliJ IDEA 2017.3 似乎不尊重下载 Gradle 的代理选项。因此,将代理选项添加到 gradle.properties 和 gradle-wrapper.properties,然后在终端中运行 ./gradlew。这将下载 Gradle。之后,IntelliJ 就可以工作了。

【讨论】:

【解决方案2】:

这也发生在我身上,问题是 Gradle 安装错误。我添加了一个 GRADLE_HOME 环境变量并将 %GRADLE_HOME%/bin 附加到 PATH。我重新启动了IDE,它工作了! :)

来源:https://docs.gradle.org/current/userguide/installation.html#sec:installation_environment_variables

【讨论】:

    【解决方案3】:

    另一个可能的警告: 检查是否设置了 GRADLE_USER_HOME 的环境变量。 Gradle 将在此目录中查找 gradle.properties

    【讨论】:

      猜你喜欢
      • 2020-07-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-15
      • 2020-09-11
      • 1970-01-01
      • 2015-11-14
      • 2016-09-25
      • 1970-01-01
      相关资源
      最近更新 更多