||
当在ubuntu13.04中安装了grails之后,运行编译项目命令,发现命令行并未使用我所设置的系统代理
方法1 亲测有效
在我机器上(32-bit Windows 2003)测试的结果表明,绰号不是放在等号后面,而是需要将参数括起来,如下:不要在项目路径下输入
grails add-proxy client "--host=10.1.2.188" "--port=80"
grails set-proxy client
方法2:亲测无效
or you could just dump everything in BuildConfig.groovy
System.properties.putAll([
"http.proxyHost": "myproxy.hostname.com",
"http.proxyPort": "8080",
"http.proxyUserName": "myUser",
"http.proxyPassword": "myPass"
])
方法3:在具体的项目中 找到BuildConfig.groovy文件 在其中添加如下代码
grails.project.dependency.resolution = {
System.setProperty("http.proxyHost", "my-proxy-host");
System.setProperty("http.proxyPort", "my-port");
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("my_nt_id","mypassword".toCharArray());
}}
……. rest of code .....
}
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-5-1 11:23
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社