[root@localhost apache-maven-3.5.2]# cd conf/
[root@localhost conf]# ls
logging settings.xml toolchains.xml
[root@localhost conf]# cp settings.xml settings.xml.bak //备份配置文件
[root@localhost conf]# vi settings.xml
找到localRepository节点,修改为maven本地仓库
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
-->
<!--设置成自己的仓库目录,绝对路径 -->
<localRepository>/opt/soft/mavenrepository/repo</localRepository>