到maven的安装目录下的conf目录下的settings.xml修改添加一行
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
下面添加
<localRepository>D:\Java\m2\repository</localRepository>
具体位置,自己填写