Java版本:1.8.0蚂蚁版本:1.7.1
我正在尝试执行这个蚂蚁来构建 jar 文件。这个蚂蚁也做http连接到maven下载一些jar文件:
由于我在代理后面,我首先这样做:
export ANT_OPTS="-Dhttp.proxyHost=prod.proxy.net -Dhttp.proxyPort=8080 -Dhttp.proxyUsername=smithJ -Dhttp.proxyPassword=Basketball123"
然后我执行这个:
CLASSPATH=/app/hbase-0.94.27/lib/hadoop-core-1.0.4.jar CFLAGS=-m64 CXXFLAGS=-m64 ant -v compile-native tar
我收到这些错误:
ivy-download:
[get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
[get] To: /app/hadoop-lzo/ivy/ivy-2.2.0.jar
[get] Error opening connection java.io.IOException: Server returned HTTP response code: 407 for URL: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
[get] Error opening connection java.io.IOException: Server returned HTTP response code: 407 for URL: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
[get] Error opening connection java.io.IOException: Server returned HTTP response code: 407 for URL: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
[get] Can't get http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar to /app/hadoop-lzo/ivy/ivy-2.2.0.jar
407 错误是代理身份验证错误。我在这里做错了什么?如何在代理中进行身份验证以获取 http 文件?
我也试过这个:
CLASSPATH=/app/hbase-0.94.27/lib/hadoop-core-1.0.4.jar CFLAGS=-m64 CXXFLAGS=-m64 ant -Dhttp.proxyHost=prod.proxy.net -Dhttp.proxyPort=8080 -Dhttp.proxyUsername=smithJ -Dhttp.proxyPassword=Basketball123 compile-native tar
仍然是 407 个错误。
检查这个:
set ANT_OPTS=-Dhttp.proxyHost=myproxyhost -Dhttp.proxyPort=8080 -Dhttp.proxyUser=myproxyusername -Dhttp.proxyPassword=myproxypassword -Dhttps.proxyHost=myproxyhost -Dhttps.proxyPort=8080
该指南是"-Dhttp.proxyUser"
的,而不是在您的情况下"-Dhttp.proxyUsername=smithJ"
,这就是为什么我总是告诉其他人复制而不是打字。
指南:http://ant.apache.org/ivy/faq.html