maven常见异常以及解决方法

时间:2023-03-08 19:10:00
maven常见异常以及解决方法

本文写的是我在整合ssm框架时遇到的一些问题,我估计很多人也会遇到,所以,这里作为一个总结,希望能够帮助大家解决问题

一,加入shiro组件时抛出的异常

加入步骤(略)

问题

1,保存后,无法导入shiro包的,信息如下

Description Resource Path Location Type
ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.shiro:shiro-core:jar:1.3.2: ArtifactResolutionException: Failure to transfer org.apache.shiro:shiro-core:pom:1.3.2 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.shiro:shiro-core:pom:1.3.2 from/to central (http://repo1.maven.org/maven2): connection timed out to http://repo1.maven.org/maven2/org/apache/shiro/shiro-core/1.3.2/shiro-core-1.3.2.pom pom.xml /shirotest line 1 Maven Dependency Problem

先看看log信息,说是伪描述异常,然后导致的timeout无法连接的错误,然后在网上找资料啊,有的说可以使用下面的方法

right click on project -> maven -> update-project -> force to update snapshot/release -> OK.

但是这个方法对我并没有什么作用,既然是无法连接,那我就自己连接http://repo1.maven.org/maven2,看看是不是能连上,结果,是连不上。在继续google,得到这样的答案:http://repo1.maven.org/maven2这个*仓库地址已经被屏蔽了,被屏蔽固然没法连接了,解决方法呢,就是建立私服nexus,既然这个不能用,那我就换版本吧,换为1.2.4,问题解决了。