记录今天遇到的问题~

第一次用maven,最大的感受是,不用苦苦得找jar包了 TAT

记录今天导入maven时遇到的问题,及解决方法。

bug1:

Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 
from https://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.apache.maven.plugins:maven-resources-plugin:pom:2.6 
from/to central (https://repo.maven.apache.org/maven2): connect timed out

solution:
add to pom.xml:

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.6</version>
</dependency>


bug2:

Project 'zhku.springmvc1' is missing required source folder: 'src/main/resources/templates'

cause:
开发环境中,eclipse.project文件可能存在对缺失文件夹的引用,但是project中已经没有了该文件夹,导致编译的时候找不到该文件夹。

solution:
选中project-->右键-->properties--->java build path-->Source,把缺少的文件夹remove掉,重新编译就ok了

bug3:

Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 
from https://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.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 
from/to central (https://repo.maven.apache.org/maven2): connect timed out

cause:
从错误提示看到,maven-compiler-plugin:pom:2.12.4 从maven网上下载失败是由于本地仓库已经有该插件的缓存了,搜索了该文件后才知道在另一个本地仓库路径下有缓存该插件。

solution:
1、首先删掉另一个本地仓库已缓存的 ~.m2\repository\org\apache\maven\plugins\maven-surefire-plugin\2.12.4目录;


2、然后通过 maven->update projects,勾上 force update of snapshots/releases ,更新工程即可。


所以本地的maven仓库最好只设置一个。(应该是之前下载过maven,在D:\collegePro)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值