idea 中使用maven遇到的坑

1.在pom中添加dependency 後 沒法把依賴下載到項目中【External Libraries】apache

視圖如:segmentfault

解決方法:maven

(1)檢查idea 的setting.xl文件配置路徑是否配置正確ide

(2)從新導入maven依賴到項目中(reimport)idea

 

備註:能夠在idea中把import Maven projects automatically 選項選中 ,那麼在pom中添加dependency依賴 後 jar就會自動引入到項目中spa

參考連接:https://segmentfault.com/a/1190000009449467.net

 

2.每次down項目時檢查idea 的file-->settings--->maven 的配置,確保下載下來的項目能夠正確使用mavendebug

 

 

3.Idea不能新建package的解決3d

參考連接:https://blog.csdn.net/cherry_xiu/article/details/80008982orm

 

 

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 目錄正在被使用

場景:

此時我正停留在target目錄中,因此致使target沒法刪除。

相關文章
相關標籤/搜索