1. 程式人生 > 其它 >idea 使用 mvn clean package 報錯 Could not create local repository at

idea 使用 mvn clean package 報錯 Could not create local repository at

使用 mac 版本的 idea 打包使用打包命令 mvn clean package 總是報錯:

[ERROR] Could not create local repository at /Repository -> [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/LocalRepositoryNotAccessibleException

在網上找了很多方法,都是講maven的配置路徑找不到。同樣的問題在windows 系統沒有問題,在mac上就有問題。 maven 配置也沒有問題,配置各種路徑也存在:

解決方案

Could not create local repository at /Repository

無法建立本地倉庫,去找 setting.xml 配置檔案:

<localRepository>/Repository</localRepository>

修改成本地的倉庫路徑:

<localRepository>/Users/opt/Repository</localRepository>