【发布时间】:2017-05-02 10:44:57
【问题描述】:
根据https://jhipster.github.io/configuring-a-corporate-proxy/,我在 /.m2/settings.xml 中设置了我的代理设置,如下所示:
<proxies>
<proxy>
<id>myId</id>
<active>true</active>
<protocol>http</protocol>
<username>myDomain\myUsername</username>
<password>myPassword</password>
<host>myHost</host>
<port>myPort</port>
</proxy>
</proxies>
但不知何故,当我尝试 mvnw 项目时它不起作用,它给了我:
Exception in thread "main" java.net.ConnectException: Connection refused: connect
我在将以下参数传递给 MAVEN_OPTS 时设法让它工作,但我想只使用 settings.xml 文件。
set MAVEN_OPTS=-Dhttps.proxyHost=myHost -Dhttps.proxyPort=myPort -Dhttps.proxyUser=myDomain\myUsername -Dhttps.proxyPassword=myPassword
有人可以帮忙吗?
提前致谢。
【问题讨论】:
-
在 MAVEN_OPTS 中使用 https 时在 settings.xml 中设置 http 是否正常?
-
Maven 应该使用 http 处理 https。无论如何我试图把https,同样的错误。
标签: maven https proxy jhipster