今天导入一个新的工程,从阿里云更新依赖包一直失败。
点击maven的刷新时报错:
Connection refused: connect
无其他提示信息,遂查找解决方法。
更改maven配置。
![](https://img-blog.csdnimg.cn/img_convert/f3ede18920c4f7a87885eaca2fa673ed.png)
修改后仍然报错。
修改maven关联的jdk。
![](https://img-blog.csdnimg.cn/img_convert/ae17afa0031979fc160efd1d987fd58e.png)
修改后仍然无效
查看idea日志。
![](https://img-blog.csdnimg.cn/img_convert/e0dd726a9f3f7224d6672b0a7d5f5c57.png)
![](https://img-blog.csdnimg.cn/img_convert/ef67debad6a3f7144a54c0e3c244e695.png)
发现是连不上https://maven.aliyun.com(443端口)
增加vm选项
![](https://img-blog.csdnimg.cn/img_convert/c8cbbf69cfa8808d1ea0ad3d590ad7e6.png)
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true
遂解决。
分析原因,应该是本地对https的访问有限制。此问题藏得有点深,没有耐心很难解决。