idea 中使用maven遇到的坑

1.在pom中添加dependency 后 无法把依赖下载到项目中【External Libraries】

视图如:4b8da2e59446f8bfba460d8b6b98d835e09.jpg

解决方法:

(1)检查idea 的setting.xl文件配置路径是否配置正确

(2)重新导入maven依赖到项目中(reimport)

 

备注:可以在idea中把import Maven projects automatically 选项选中 ,那么在pom中添加dependency依赖 后 jar就会自动引入到项目中

参考链接:https://segmentfault.com/a/1190000009449467

 

2.每次down项目时检查idea 的file-->settings--->maven 的配置,确保下载下来的项目可以正确使用maven

539af414a182a37c08d250276e33677dd4b.jpg

 

 

3.Idea不能新建package的解决

参考链接:https://blog.csdn.net/cherry_xiu/article/details/80008982

 

 

4.mvn clean 失败error 如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.0.0:clean (default-clean) on project projectX: Failed to clean project: Failed to delete D:\idea-workspace\branches\projectX\target -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

可以原因target 目录正在被使用

场景:

28019e85401ee9e69608e6d5ea665f6ad8a.jpg

此时我正停留在target目录中,所以导致target无法删除。

 

转载于:https://my.oschina.net/qimhkaiyuan/blog/3037449

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值