2012-02-15 96 views
4

我在网络环境中工作。我的网络IP地址是:maven:传输文件错误:连接被拒绝:连接

IE-> tools-> internet options-> connections-> LAN settings->使用自动配置脚本(启用):地址:http://autocache.abc.com/

端口地址未在IE设置中指定。

当我这样做平autocache.abc.com它给下面的IP地址:16.234.18.243

在settings.xml文件中我启用了代理条目为:

<proxy> 
     <id>genproxy</id> 
     <active>true</active> 
     <protocol>http</protocol> 
     <host>autocache.abc.com</host> 
</proxy> 

没有在指定即主机即:IE->工具 - >连接 - > LAN设置 - >高级 - > HTTP显示空

,如果我跑MVN安装收到以下错误:

[INFO] Scanning for projects... 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building home-app 
[INFO] task-segment: [install] 
[INFO] ------------------------------------------------------------------------ 
[INFO] [resources:resources {execution: default-resources}] 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 4 resources 
Downloading: https://repository.jboss.org/nexus/content/repositories/releases//org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom 
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository jboss (https://repository.jboss.org/nexus/content/repositories/releases/): Error transferring file: Connection refused: connect 
Downloading: http://repository.springsource.com/maven/bundles/release/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom 
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release): Error transferring file: Connection refused: connect 
Downloading: http://repository.springsource.com/maven/bundles/external/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom 
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external): Error transferring file: Connection refused: connect 
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom 
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect 
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] Error building POM (may not be this project's POM). 


Project ID: org.springframework:spring-orm:jar:3.0.6.RELEASE 

Reason: Cannot find parent: org.springframework:spring-parent for project: org.springframework:spring-orm:jar:3.0.6.RELEASE for project org.springframework:spring-orm:jar:3.0.6.RELEASE 


[INFO] ------------------------------------------------------------------------ 
[INFO] For more information, run Maven with the -e switch 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 11 seconds 
[INFO] Finished at: Wed Feb 15 11:40:32 IST 2012 
[INFO] Final Memory: 11M/27M 
[INFO] ------------------------------------------------------------------------ 

如果我运行没有网络连接,即在我的私人互联网连接的mvn安装,它工作正常,只有问题是与网络代理。

我强烈地感觉到这是主机问题,如果我将主机设置为16.234.18.243而不是autocache.abc.com,仍会给出相同的错误。

我试图创建新的本地存储库(即删除现有的目录),但仍然是同样的问题。

回答

4

1>打开IE(或任何浏览器),

2>给网址为http://autocache.abc.com/(你上面给出),然后输入一个文件将与的.pac格式下载,保存到桌面

3> textpad打开.pac文件识别代理:

在你的编辑器,它会是这样的:

return "PROXY web-proxy.ind.abc.com:8080; PROXY proxy.sgp.abc.com:8080"; 

4>去的Maven的settings.xml和作为输入:

<proxy> 
     <id>optional</id> 
     <active>true</active> 
     <protocol>http</protocol>   
     <host>web-proxy.ind.abc.com</host> 
     <port>8080</port>   
</proxy> 

5>运行mvn:通过命令提示安装或通过蚀运行。

通过maven-in-5-min-not-working

4

您指定的URL最可能包含Proxy auto-config文件。您需要下载它并查看它中指定的代理设置。

例如,该文件的内容

function FindProxyForURL(url, host) 
    { 
     return "PROXY proxy.example.com:8080; DIRECT"; 
    } 

表明您应该使用代理服务器proxy.example.com 8080端口

对于更复杂的例子,看How to configure Maven behind an auto configured proxy

相关问题