使用maven时出现failure to transfer错误,下载jar慢
2017-03-30 14:54
561 查看
在eclipse里使用maven,连接nexus私服。
添加依赖之后,总是报添加的依赖jar文件找不到,但是在nexus的库里面能找到这个依赖的jar文件,但是在本地的maven库里面找不到,于是我将本地库里面这个依赖对应的文件夹删掉,然后在eclipse里面执行update
dependencies。成功解决问题!
右键单击项目->maven->update dependencies。
引起的原因是由于本地库从nexus中请求jar文件,如果私服中不存在则取网上下载,如果网速过慢,下载时间超过了maven设置的时间限制就会报该错误。
加入阿里云资源,速度会快很多
在settings.xml文件中加入
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
</mirrors>
添加依赖之后,总是报添加的依赖jar文件找不到,但是在nexus的库里面能找到这个依赖的jar文件,但是在本地的maven库里面找不到,于是我将本地库里面这个依赖对应的文件夹删掉,然后在eclipse里面执行update
dependencies。成功解决问题!
右键单击项目->maven->update dependencies。
引起的原因是由于本地库从nexus中请求jar文件,如果私服中不存在则取网上下载,如果网速过慢,下载时间超过了maven设置的时间限制就会报该错误。
加入阿里云资源,速度会快很多
在settings.xml文件中加入
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
</mirrors>
相关文章推荐
- 使用maven时出现Failure to transfer 错误的解决方法
- 后台——使用maven时出现Failure to transfer 错误的解决方法
- 使用maven时出现Failure to transfer 错误的解决方法
- 使用maven时出现Failure to transfer 错误的解决方法(再次掉入神坑)
- Maven新导入项目时出现错误Failure to transfer commons-lang:commons-lang:jar:2.1 from https://repo.maven.apache.
- 解决eclipse中maven出现的Failure to transfer XXX.jar的问题
- 使用maven 出现ArtifactTransferException:Failure to transfer
- 使用maven 出现ArtifactTransferException:Failure to transfer
- 使用maven 出现ArtifactTransferException:Failure to transfer
- Maven 工程错误Failure to transfer org.codehaus.plexus:plexus-io:pom:1.0,Failure to transfer org.codehaus.plexus:plexus-archiver:jar:2.0.1
- 使用maven 出现ArtifactTransferException:Failure to transfer
- maven的pom 提示错误 Failure to transfer com.thoughtworks.xstream:xstream:jar:
- log4j的1.2.15版本,在pom.xml中的顶层project报错错误: Failure to transfer javax.jms:jms:jar:1.1 from https://maven-repository.dev.java.net/nonav/repository......
- Maven错误问题解决 Failure to transfer com.thoughtworks.xstream:xstream:jar:1.3.1 from https://repo.maven
- maven项目的pom.xml文件出现红色错误提示:ArtifactTransferException: Failure to transfer
- maven项目下载报错:Failure to transfer org.apache.maven:maven-archiver:jar:x.x from https://repo.maven.apache.org/maven...
- maven的pom 提示错误 Failure to transfer com.thoughtworks.xstream:xstream:jar:
- eclipse安装maven插件开发WEB项目,解决错误:Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom
- Maven工程错误 之 Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0
- Failure to transfer org.apache.maven:maven-archiver:jar:x.x from https://repo.maven.apache.org/maven