gpt4 book ai didi

maven - 如何让 maven 不使用 settings.xml 中的第一个代理?

转载 作者:行者123 更新时间:2023-12-04 12:02:05 25 4
gpt4 key购买 nike

Maven 允许定义多个代理:

<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
<proxy>
<id>proxy_gcp</id>
<active>true</active>
<protocol>http</protocol>
<host>app-proxy.gcp.acme.fr</host>
<port>80</port>
</proxy>
<proxy>
<id>proxy_aws</id>
<active>false</active>
<protocol>http</protocol>
<host>app-proxy.aws.acme.fr</host>
<port>80</port>
</proxy>
</proxies>
按照默认 settings.xml 中的规定, Unless otherwise specified (by system property or command-line switch), the first proxy specification in this list marked as active will be used .
但是我找不到关于如何通过系统属性或命令行开关指定其他方式的任何方向。
如何告诉 Maven 使用列表中的第二个代理(命令行或带有属性)?

最佳答案

它指的是 JVM 级别的系统属性,而不是 Maven 的:https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html

$ mvn install -Dhttp.proxyHost=<host> -Dhttp.proxyPort=<port> -Dhttp.nonProxyHosts=<nonProxyHosts>

关于maven - 如何让 maven 不使用 settings.xml 中的第一个代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67022473/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com