重要的是settings.xml文件的配置
1.设置本地仓库路径
<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:\repository</localRepository>
...
</settings>
2.将镜像地址设置为本地仓库地址
<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:\repository</localRepository>
<mirrors>
<mirror>
<id>central</id>
<mirrorOf>*</mirrorOf>
<name>central</name>
<url>file://D:\repository</url>
</mirror>
</mirrors>
</settings>
注意:离线模型不用设置,我设置了之后打包报错