2012-02-15 121 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

相關問題