Gradle Proxy Configuration
Gradle requires access to the web to integrate with services such as Artifactory. When working behind a proxy server, you may encounter issues if proper configuration is not set.
Manual Proxy Configuration
As described in the question, manually adding the Artifactory plugin and defining proxy settings in .gradle/gradle.properties can be unsuccessful.
Solution
The provided solution offers a more detailed configuration approach:
gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128"-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost"
gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 "-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost"
gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129"-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost"
gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 -Dhttps.proxyUser=user -Dhttps.proxyPassword=pass -Dhttp.proxyUser=user -Dhttp.proxyPassword=pass -Dhttp.nonProxyHosts=host1.com|host2.com"
The above configurations can be placed in either gradle.properties (in home directory or project directory) or gradle-wrapper.properties.
The above is the detailed content of How to Configure Gradle to Work Behind a Proxy Server?. For more information, please follow other related articles on the PHP Chinese website!