maven:传输文件时出错:连接被拒绝:连接

标签 maven maven-2

我在网络环境中工作。
我的互联网网络 IP 地址是:

IE->工具->网络选项->连接->局域网设置->使用自动配置脚本(启用):地址: http://autocache.abc.com/

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

当我执行 ping 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主机上没有指定任何内容,即:IE->工具->连接->局域网设置->高级->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 install ,即在我的私有(private)互联网连接上,它工作正常,唯一的问题是网络代理。

我强烈认为这是主机问题,如果我将主机指定为 16.234.18.243 而不是 autocache.abc.com,仍然会出现同样的错误。

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

最佳答案

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

2> 将 url 设为 http://autocache.abc.com/ (上面已经给出)并输入,将下载一个.pac格式的文件,保存到桌面

3> 在 textpad 中打开 .pac 文件,识别 PROXY:

在您的编辑器中,它将类似于:

   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:install 或通过 eclipse 运行。

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

关于maven:传输文件时出错:连接被拒绝:连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9289217/

相关文章:

maven 原型(prototype) :generate failure caused by org. apache.maven.plugin.MojoFailureException

maven-2 - 如果调用迭代,maven appassembler 插件不包含当前工件

java - 如何在 Spring Boot 中获取 log4j2.properties 文件以从 pom.xml 读取文件名

maven - 放置大型测试数据集的最佳实践?

java - Jmeter测试使用maven运行

java - 如何使用 Cobertura 检测多项目 Maven 2?

java - Eclipse 中的 Maven 2 项目错误图标

maven-2 - 要使用的主要/最佳 Maven 存储库是什么?

maven - 如何修复使用 GCSUtil 写入文件时有关线程组仍在运行的 Maven 警告?

java - Maven 配置不起作用