edwinuestc的个人博客分享 http://blog.sciencenet.cn/u/edwinuestc

博文

grails命令行的代理设置

已有 2970 次阅读 2014-1-23 13:27 |个人分类:程序调试|系统分类:科研笔记

当在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 .....
}





https://wap.sciencenet.cn/blog-615874-761517.html

上一篇:[转载]ubuntu13.10 sublime text3 中文支持的问题
下一篇:Rweibo试玩
收藏 IP: 218.80.250.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-1 20:00

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部