遇到的问题----新建maven项目ArtifactTransferException 和Execution default-testResources of goal或者导入maven报错
2016-12-23 09:22
453 查看
第一种错误:
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
如图:
![](http://img.blog.csdn.net/20141115130256153?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvenpxOTAwNTAz/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
这两个错误的原因是本工程依赖的包 在本地仓库中存在,曾经下载中超时或者未下载成功。
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再刷新项目
![](http://img.blog.csdn.net/20141115133911733?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvenpxOTAwNTAz/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
我自己的: 看看有没有 settings.xml 文件。没有的话找个别人的复制,放在上面的栏中就行了(我的这么解决了)
![](http://img.blog.csdn.net/20141115133948078?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvenpxOTAwNTAz/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
自我评价: 感觉一直犯这个错,就收藏了
原文链接: http://blog.csdn.net/zzq900503/article/details/41144803
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项目ArtifactTransferException 和Execution default-testResources of goal
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:testReso
- Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.3:run (default-cli) on project Maven_WebTest: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.3:run failed: C
- spring boot 项目打包时报错 Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.
- SpringBoot创建项目问题:ArtifactTransferException:Failure to transfer maven……
- 导入新建maven项目之创建test文件_classpath问题
- 近两天maven项目导入遇到的问题
- maven 从svn导入项目遇到的问题 No marketplace entries found to handle yuicompressor maven plugin:1.3.0:compile
- 遇到问题-----maven项目右键运行或者run as运行main方法找不到类
- 导入maven项目遇到的问题
- 导入项目后Maven的问题 Error:Cause: org/gradle/api/publication/maven/internal/DefaultMavenFactory
- android studio 新建或者导入项目时缓慢或卡死的问题
- Intellij Idea导入非maven Web项目时遇到lib目录冲突的问题
- 【studio导入项目遇到问题二】Error:Unable to calculate percentage: 6686 of -3459085. All inputs must be >= 0
- 新建一个maven spring boot项目中遇到的问题
- MyEclipse导入Maven项目遇到的几个问题
- Android开发中遇到的问题(五)——Eclipse导入Android项目出现"Invalid project description overlaps the location of another project"错误的解决办法
- Eclipse导入maven项目时报错:maven-resources-plugin:2.5 or one of its dependencies could not be resolved
- 关于Android开发导入已有项目遇到Project has no default.properties file! Edit the project properties to set one.问题的解决方法