遇到的问题----新建maven项目ArtifactTransferException 和Execution default-testResources of goal或者导入maven报错
来源:互联网 发布:网络丢包怎么解决 编辑:程序博客网 时间:2024/06/18 06:19
第一种错误:
ArtifactTransferException: Failure to transfer com.google.collections:google-collections:jar:1.0 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 com.google.collections:google-collections:jar:1.0 from/to central (http://repo1.maven.org/maven2):
No response received after 60000
第二种错误:
Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources failed: Unable to load
the mojo 'testResources' in the plugin 'org.apache.maven.plugins:maven-resources-plugin:2.4.3'. A required class is missing: Lorg/sonatype/
plexus/build/incremental/BuildContext; ----------------------------------------------------- realm = plugin>org.apache.maven.plugins:maven-
resources-plugin:2.4.3 strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy urls[0] = file:/D:/maven/repository/org/apache/
maven/plugins/maven-resources-plugin/2.4.3/maven-resources-plugin-2.4.3.jar urls[1] = file:/D:/maven/repository/org/apache/maven/
reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar urls[2] = file:/D:/maven/repository/org/apache/maven/doxia/doxia-sink-api/
1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar urls[3] = file:/D:/maven/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar urls[4] = file:/
D:/maven/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar urls[5] = file:/D:/maven/
repository/junit/junit/3.8.1/junit-3.8.1.jar urls[6] = file:/D:/maven/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar u
如图:
这两个错误的原因是本工程依赖的包 在本地仓库中存在,曾经下载中超时或者未下载成功。
Maven不管下没下成功,都会有一个.lastupdate文件,一旦出现了这个文件,而你指定远程仓库的方式是mirror,而不是profile里的repository,那么Maven默认不会去更新这个文件
解决方法两个步骤:
1.找到自己的本地仓库,(有关本地仓库详见:Maven本地仓库路径修改),默认的路径在本地用户的临时文件夹下面的 .m2 文件夹下的 repository 下,例如:C:\Users\joe\.m2\repository 把repository下的文件夹全部删除,或者只把相关报错的包的目录删除
2. MyEclipse --> Preferences -->Maven4MyEclipse ---> User Settings
点击按钮 Update Settings 和 点击 Reindex按钮
刷新项目,应该就没有报错信息了,如果还有,试试重启MyEclipse再刷新项目
我自己的: 看看有没有 settings.xml 文件。没有的话找个别人的复制,放在上面的栏中就行了(我的这么解决了)
自我评价: 感觉一直犯这个错,就收藏了
原文链接: http://blog.csdn.net/zzq900503/article/details/41144803
- 遇到的问题----新建maven项目ArtifactTransferException 和Execution default-testResources of goal或者导入maven报错
- 遇到的问题----新建maven项目ArtifactTransferException 和Execution default-testResources of goal
- 关于maven的错误Execution default-testResources of goal org.apache.maven.plugins:maven-resources-
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:testReso
- Execution default-testResources of goal 问题解决
- spring boot 项目打包时报错 Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.
- maven mvn Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin: 2.5
- Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources...
- Eclipse新建maven项目报错:Discover and map Eclipse plugins to Maven plugin goal executions
- Eclipse新建maven项目报错:Discover and map Eclipse plugins to Maven plugin goal executions
- Maven项目报错:Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clea
- 新建maven项目pom报错的问题
- 新建的maven项目中jsp文件报错问题
- 在eclipse 集成maven 用于新建或者导入maven项目
- Linux下Eclipse新建maven项目报错:Discover and map Eclipse plugins to Maven plugin goal executions
- Maven新建项目报错
- Maven新建项目报错
- maven 新建项目报错
- java设计模式
- spring拦截器配置
- zabbix自带mysql模板监控mysql
- 第十章 利用k-均值聚类算法对未标注数据分组
- oracle全托管驱动Oracle.ManagedDataAccess
- 遇到的问题----新建maven项目ArtifactTransferException 和Execution default-testResources of goal或者导入maven报错
- 微信授权php获取用户基本信息
- SQL的四种连接-左外连接、右外连接、内连接、全连接
- Xcode配置_Search Paths
- java thread的stop,suspend,resume等方法废弃的原因
- vs2008 MFC使用DataGrid控件绑定数据库
- 关系模型
- 使用TextRank算法为文本生成关键字和摘要
- 新闻热点