Maven依赖项没有下载,代理问题?

Pan*_*005 5 maven-3 maven

当前的WinHTTP代理设置:Windows机器中的直接访问(无代理服务器).并在settings.xml中.但是,罐子没有下载并且低于错误.

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor fo
Run Code Online (Sandbox Code Playgroud)

r org.apache.maven.plugins:maven-clean-plugin:jar:2.5:无法传输工件org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central(https:// repo .maven.apache.org/maven2):连接到repo.maven.apache.org:443 [repo.maven.apache.org/151.101.24.215]失败:连接超时:连接 - > [帮助1]

Aja*_*jax 15

根据maven文档,我们必须在其中添加一些settings.xml设置,在此处提到代理指南.

<settings>
   <proxies>
      <proxy>
        <id>example-proxy</id>
        <active>true</active>
        <protocol>http</protocol>
        <host>proxy.example.com</host>
        <port>8080</port>
        <username>proxyuser</username>
        <password>somepassword</password>
        <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
      </proxy>
   </proxies>
   .
   .
</settings>
Run Code Online (Sandbox Code Playgroud)

另一种快速下载依赖关系的方法如下

mvn clean install -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=YourPort 
Run Code Online (Sandbox Code Playgroud)

第二个对我来说很好.希望至少上述解决方案之一对您有用,希望您的网络没有来自maven repo的任何被阻止的服务器.