gpt4 book ai didi

java - 全局 gradle 代理设置?

转载 作者:IT老高 更新时间:2023-10-28 21:14:47 24 4
gpt4 key购买 nike

有什么方法可以简单地为 gradle 设置全局、系统范围的代理?

是的,我知道 current gradle.properties 文件中有一个 systemProp.http.proxyHost, ...etc 设置,但它仅适用于实际项目。但是

  • 我不会在每个 gradle 项目中都设置它
  • 而且我不会因为我的本地网络配置而更改项目的源代码。

那么,有没有“global gradle.properties”文件之类的?

最佳答案

是的,这似乎是可能的。见 here ,特别是:

We can define a gradle.properties file and set the property in this file. We can place the file in our project directory or in the <USER_HOME>/.gradle directory. The properties defined in the property file in our home directory take precedence over the properties defined in the file in our project directory. As a bonus we can also define system properties in a gradle.properties file, we only have to prefix the property name with systemProp..

gradle.properties 文件位于以下路径:

# windows gradle file
%userprofile%\.gradle\gradle.properties

# linux gradle file
~/.gradle/gradle.properties

关于java - 全局 gradle 代理设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26523804/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com