使用Maven 构建项目的时候 pom.xml 异常:ArtifactTransferException: Failure to transfer org.springframework:spring

来源:互联网 发布:贰贰网络 编辑:程序博客网 时间:2024/06/05 19:24

<dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>3.2.2.RELEASE</version></dependency>


以上配置异常如下:

ArtifactTransferException: Failure to transfer org.springframework:spring-web:jar:3.2.2.RELEASE from http://repo.maven.apache.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.springframework:spring-web:jar:3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/org/springframework/spring-web/3.2.2.RELEASE/spring-web-3.2.2.RELEASE.jar


分析原因:连接不到中央仓库 http://repo.maven.apache.org/maven2 导致报错


解决方案:设置镜像屏蔽中央仓库地址, 替换成 http://uk.maven.org/maven2

<mirror><id>uk.maven.org</id>        <mirrorOf>central</mirrorOf>        <name>UK Central</name>        <url>http://uk.maven.org/maven2</url></mirror>



0 0
原创粉丝点击