我正在尝试在Windows上构建Hadoop-24。 突然之间一切正常:
[INFO] Apache Hadoop HttpFS .............................. FAILURE [8.568s]
相关的错误是:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7: run (dist) on project hadoop-hdfs-httpfs: An Ant BuildException has occured: java.net.ConnectException: Connection refused: connect
[ERROR] around Ant part ...<get dest="downloads/apache-tomcat-6.0.36.tar.gz" skipexisting="true" verbose="true" src="http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz"/>... @ 5:182 in C:\hadoop-src\hadoop-hdfs-project\hadoop-hdfs-httpfs\target\antrun\build-main.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-hdfs-httpfs: An Ant BuildException has occured: java.net.ConnectException: Connection refused: connect
around Ant part ...<get dest="downloads/apache-tomcat-6.0.36.tar.gz" skipexisting="true" verbose="true" src="http://archive.apache.org/dist/tomcat/tomcat-6/v6.0
.36/bin/apache-tomcat-6.0.36.tar.gz"/>... @ 5:182 in C:\hadoop-src\hadoop-hdfs-project\hadoop-hdfs-httpfs\target\antrun\build-main.xml
一切似乎都表明了连接错误。但是:
现在,我通过手动下载文件并将其放在预期的位置来避免这个问题。但是,我想理解为什么这不能自然地起作用。你们有人会看到原因吗?
答案 0 :(得分:1)
这是由于代理设置。理论上,maven应该检查/.m2下的settings.xml文件,但由于某种原因,maven ant运行插件不会这样做。所以你必须在maven命令中指定它,如下面的那个
mvn package -Dhttp.proxyHost=<your proxy host> -Dhttp.proxyPort=8080