====== Setup Grails 3 Behind Proxy ====== Most companies have set up proxy to protect, and speed up their network, but ''grails'', and ''gradle'' would not download the libraries needed correctly behind the proxy without proper setup. ===== Proxy Setting for Grails ===== - Go to the path you install grails. - Inside, go to the path ''bin''. My case would be ''D:\grails-3.3.6\bin''. - Use a text editor to open the file ''grails.bat''. - Find the line start with ''set DEFAULT_JVM_OPTS'', and change it to (in one line) set DEFAULT_JVM_OPTS="-XX:+TieredCompilation" "-XX:TieredStopAtLevel=1" "-XX:CICompilerCount=3" "-Dhttp.proxyHost=THE_PROXY_PATH" "-Dhttp.proxyPort=THE_PROXY_PORT" "-Dhttp.proxyUser=YOUR_USERNAME" "-Dhttp.proxyPassword=YOUR_PASSWORD" "-Dhttps.proxyHost=THE_PROXY_PATH" "-Dhttps.proxyPort=THE_PROXY_PORT" "-Dhttps.proxyUser=YOUR_USERNAME" "-Dhttps.proxyPassword=YOUR_PASSWORD" - Please change the values of ''THE_PROXY_PATH'', ''THE_PROXY_PORT'', ''YOUR_USERNAME'', ''YOUR_PASSWORD'' according to your own setting. - Depending on the proxy server, some of them might only provide http, or https service. - Depending on the proxy server, some of them might not require the user name, and password path. - In either case, your have to omitted the unnecessary parts for the above code. - Save the file. ===== Proxy Setting for maven or gradle ===== - Go to your own user directory. For Windows 10, it would be ''C:\Users\YOUR_LOGIN\'' - Go inside the directory called ''.m2''. - Add a file named ''settings.xml''. - Open settings.xml with a text editor. - Add the following code in such file. http true http THE_PROXY_PATH THE_PROXY_PORT YOUR_USER_NAME YOUR_PASSWORD https true https THE_PROXY_PATH THE_PROXY_PORT YOUR_USER_NAME YOUR_PASSWORD - Depending on the proxy server, some of them might only provide http, or https service. - Depending on the proxy server, some of them might not require the user name, and password path. - In either case, your have to omitted the unnecessary parts for the above code. - Save the file.