Git mvnw命令导致ConnectException

时间:2017-05-26 13:06:39

标签: git maven proxy

我正在尝试在我的机器上启动并运行以下项目:

https://github.com/spring-petclinic/spring-petclinic-angularjs.git

我一步一步地做所有事情但是仍然使用以下命令:

./mvnw clean install

在这里,我收到以下错误消息(有关我的设置的更多详细信息,请参阅下面的消息):

Downloading https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zi
Exception in thread "main" java.net.ConnectException: Connection timed out: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
    at java.net.Socket.connect(Socket.java:579)
    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
    at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:160)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:270)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:327)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:73)
    at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:60)
    at org.apache.maven.wrapper.Installer.createDist(Installer.java:64)
    at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:121)
    at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50)

我支持公司代理,但我的系统上的所有内容都应该正确配置才能使用它:

Eclipse有设置,Maven在ist Settings.xml中有设置,在我的Git中,我使用以下命令配置了代理:

git config --global http.proxy [MYPROXY]:[PORT]
git config --global https.proxy [MYPROXY]:[PORT]

1 个答案:

答案 0 :(得分:0)

与此同时,我解决了#34;通过手动安装Apache Maven 3.3.3并将安装路径bin-directory放入我的PATH-windows系统环境变量中来解决问题。另外,我没有执行mvnw命令,而是执行了mvn命令。

./mvn clean install

它有效,但它是一种快速而简单的解决方法,而不是解决方案。