kro*_*old 6

您可以使用settings.xml强制在本地计算机上运行的所有maven构建也使用本地安装的maven代理.节省自己和网络时间.

<settings xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                  http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <profile>
        <id>localcacheproxies</id>

        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>

        <repositories>
            <repository>
                <id>localCacheProxy</id>
                <url>http://my-local-proxy.com/maven-proxy</url>
            </repository>
        </repositories>
    </profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)

请注意,此settings.xml中的命名空间标题也提供了相当的智能感知,而不是此处发布的其他示例.(在Windows,Linux和Mac以及所有操作系统的主目录.m2文件夹中创建)