Could not create local repository at /var/root/.m2/repository

后端 未结 3 1740
自闭症患者
自闭症患者 2020-12-19 01:49

My local maven repo is here /Users/power/.m2/repository.

But I got this error

[java] [ERROR] Could not create local repository at /var/         


        
3条回答
  •  独厮守ぢ
    2020-12-19 02:08

    The default maven repository is

    ${user.home}/.m2/repository/
    

    but you can use settings.xml ( ${user.home}/.m2/settings.xml ) to change it to a folder that you have permissions on. Or conf/settings.xml in the ${MAVEN_HOME} and change:

    
    ...
    /path/to/local/repo/
    ...
    
    

    Ideally, you should run maven as yourself and not root to make sure you have permissions or doing 'ksu' first and then use command line.

提交回复
热议问题