Friday, July 18, 2014

Proxy Settings for Grails application



If you happen to work on more than one Grails application then it makes more sense to configure the HTTP Proxy settings in one place than in BuildConfig.groovy of each Grails project.

The following steps are for Windows7 env.
1. Create 'ProxySettings.groovy' file in C:\Users\USERID\.grails directory.
2. Add the following entries to it.

client=['http.proxyHost':'PROXY URL', 'http.proxyPort':'8080', 
        'http.proxyUser':'DOMAIN\\USERID',         
        'http.proxyPassword':'PASSWORD',             
        'http.nonProxyHosts':'IF ANY' ] 

currentProxy='client'   

Reboot/Restarting of the machine is required to affect the changes.


Additional Settings to check-in/release Grails applications/plugins into your corporate/private SVN repository and Maven repositories.
1. Create 'ettings.groovy' file in C:\Users\USERID\.grails directory.
2. Add the following entries to it.

grails.project.repos."REPO_NAME_IN_NEXUS".url="FULL_URL_OF_REPO" 
grails.project.repos."REPO_NAME_IN_NEXUS".type = "maven" 
grails.project.repos.default="REPO_NAME_IN_NEXUS" 
grails.release.scm.enabled=false 

//Example:
//grails.project.repos."my-grails-plugins".url="http://nexus.mycomp.net:8081/nexus/content/repositories/my-grails-plugins"
//grails.project.repos."my-grails-plugins".type = "maven" 
//grails.project.repos.default="my-grails-plugins" 
//grails.release.scm.enabled=false
 

No comments:

Post a Comment