Accessing the web via proxy is not working when SystemProperties are defined in in project directory

How to reproduce: 1) Work behind a corporate firewall.

  1. Execute a build: Assert that your build breaks with: Connection refused 3) Put a file in the gradle user home and define the proxy settings (as described in 4) Execute a build: Assert that this works fine. 5) Move the file from the gradle user home to the project directory 6) Delete the gradle user home/caches folder to force Gradle to download the external libraries again 7) Execute a build: The build breaks with: Connection refused

I expect the same behaviour in step 7 as in step 4. How can I achieve this behaviour with a File I can check in to version control?

I am using: Java 1.7, Gradle 2.1

which repositories do you reference to? Are you using ‘mavenCentral’ declaration in your build? with gradle 2.1 we changed the mavenCentral repository to use https instead of http.

Maybe you see a side effect of this change here and you need to update your proxy settings using ‘systemProp.https…’ instead of ‘systemProp.http…’. Can you double check this?

cheers, René

We are using the mavenCentral declaration. Both systemProp.http… and systemProp.https… are defined in the file.

The system properties set in have an effect when downloading dependencies when the file is located in gradle user home but not when it is located in project directory.

Hey christian, unfortunately I can’t reproduce this. In my environment (osx, gradle 2.1) this is working correctly. can you check if the problem exists for https and for http?


Hi Rene, thanks for checking. I found the problem: I am using a multi project build and I did only place the file in the root dir but not in the /buildSrc dir.