我们公司使用具有以下形式的用户名的公司代理domainName\username.当我尝试使用add-proxy命令从命令行添加代理时.
我得到的例外是:
Error WARNING: Error configuring proxy settings: startup failed:
C:\Documents and Settings\username\.grails\ProxySettings.groovy: 1: unexpected cha
r: '\' @ line 1, column 94.
8080", "http.proxyUser":"company\username"
Run Code Online (Sandbox Code Playgroud)
这是什么解决方法?我尝试手动编辑ProxySettings.groovy文件,但启动时会抛出相同的错误.
[更新]我尝试使用Grails 2.0.0 RC3,但仍然无法连接.
在代理配置中使用域时,您似乎遇到了一个grails错误:http://jira.grails.org/browse/GRAILS-7387.解决方法是在BuildConfig.groovy(手动)类型内配置代理.将以下内容添加到现有内容中company\username:
grails.project.dependency.resolution = {
System.setProperty("http.proxyHost", "host");
System.setProperty("http.proxyPort", "port");
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("company\\username","password".toCharArray());
}
});
[rest of code]
}
Run Code Online (Sandbox Code Playgroud)
这样反斜杠应该没有问题.
| 归档时间: |
|
| 查看次数: |
1371 次 |
| 最近记录: |