merours
merours

Reputation: 4106

Connection refused with maven + ant :

I'm trying to build Hadoop-24 on windows. Everything works fine when suddenly :

[INFO] Apache Hadoop HttpFS .............................. FAILURE [8.568s]

The associated error is this :

[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

Everything seems to indicate a connexion error. However :

  1. the other packages were downloaded without trouble (via Maven and Ant)
  2. the proxy is well configured (see first point)
  3. I can download the aforementioned file via firefox.

Right now, I dodged this problem by downloading manually the file and putting it where it's expected. However, I would like to understand why is this not working naturally. Would you folks see the reason why ?

Upvotes: 4

Views: 1879

Answers (1)

buqing
buqing

Reputation: 995

It is due to the proxy settings. In theory, maven should check the settings.xml file under /.m2 but for some reason, the maven ant run plugin doesn't do that. So you have to specify it in the maven command like the one below

mvn package -Dhttp.proxyHost=<your proxy host> -Dhttp.proxyPort=8080

Upvotes: 1

Related Questions