我在代理服務器后面使用Maven 3.1.1。相同的代理處理兩者HTTP
和HTTPS
流量。
我似乎無法告訴maven settings.xml
使用這兩種協議。在我看來,只能使用一個活動代理,因為首先使用了定義的活動代理,並忽略后續的“活動”代理定義。這是我的settings.xml
:
<proxies> <proxy> <id>myhttpproxy</id> <active>true</active> <protocol>http</protocol> <host>192.168.1.2</host> <port>3128</port> <nonProxyHosts>localhost</nonProxyHosts> </proxy> <proxy> <id>myhttpsproxy</id> <active>true</active> <protocol>https</protocol> <host>192.168.1.2</host> <port>3128</port> <nonProxyHosts>localhost</nonProxyHosts> </proxy> </proxies>
是否可以為maven HTTP
和HTTPS
maven 配置代理settings.xml
?我知道我可以通過將Java系統屬性傳遞給maven調用來解決這個問題,例如:
-Dhttps.proxyHost=192.168.1.2 -Dhttps.proxyPort=3128
轉自
如何在Maven的settings.xml中為HTTP和HTTPS配置代理服務器? - 問答 - 雲+社區 - 騰訊雲
https://cloud.tencent.com/developer/ask/191609