我只需使用提供的make文件就可以安装一个软件(Apache Thrift)。当我运行make per guide时,我得到:
Buildfile: /home/john/thrift/lib/java/build.xml
setup.init:
mvn.ant.tasks.check:
proxy:
mvn.ant.tasks.download:
[get] Getting: http://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
[get] To: /home/john/thrift/lib/java/build/tools/maven-ant-tasks-2.1.3.jar
mvn.init:
[artifact:dependencies] [WARNING] Overriding profile: 'maven-ant-tasks-repo-profile' (source: pom) with new instance from source: pom
[artifact:dependencies] Downloading: org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.pom from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Error transferring file: Connection timed out它看起来确实像是代理问题,所以我在maven conf文件/usr/share/maven2/conf/settings.xml中配置了我的代理设置。当这仍然不起作用时,在终端上,我会这样做
export ANT_OPTS="-Dhttp.proxyHost=[MyProxyName] -Dhttp.proxyPort=[MyProxyPort] -Dhttps.proxyHost=[MyProxyName] -Dhttps.proxyPort=[MyProxyPort]"
然后再次运行make。这一次我通过了上面的行mvn.ant.tasks.download,但是mvn.init超时了。
哪里是设置代理设置的适当位置,以便Maven和Ant可以选择这些设置?或者在Thrift配置文件、.pom文件或类似的文件中指定这些设置?提前感谢!
发布于 2016-08-01 09:39:56
问题已解决。您可以将代理设置放在~/.m2/settings.xml中。
<settings>
<proxies>
<proxy>
<id>http_proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>YOUR_HOST</host>
<port>YOUR_PORT</port>
<nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>
</proxies>
</settings>https://stackoverflow.com/questions/38689757
复制相似问题