Pages

Saturday, March 31, 2012

I was trying to setup gradle wrapper to work with Teamcity behind a proxy but only to realize that gradle wrapper was not using the java proxy options I was providing in command line. I decided to tweak the gradlew.sh and gradlew.bat a little to make it use the proxy so that I can provide proxy options in teamcity console when I configure the build step using gradlew. I don’t have access to build agents to configure gradle with properties file. Insert the below code in batch and shell script at a place between the first line and last line (Just before the invocation of GradleWrapperMain). If you put below pieces of code at wrong place then this will not work.