在您的 pom 中重新定义“中央”存储库:
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://localAddress[:localPort]/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://localAddress[:localPort]/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://localAddress[:localPort]/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://localAddress[:localPort]/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
或者将更多存储库部分添加到您的 pom
<repository>
<id>localRepo</id>
<name>libs-release</name>
<url>http://localAddress[:localPort]/artifactory/libs-release</url>
</repository>
或者,如果您在本地 repo (.m2/repository/) 中有所有工件,则以离线模式运行编译:
mvn -o clean install