Hello,

Maven allows multiple proxies to be defined:

<!-- 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>

As stipulated in the default 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.

But I couldn't find any direction on how to specify otherwise by system
property or command-line switch.

How can I tell maven to use the second proxy in the list (command line, or
with properties) ?

Precision: I'm not looking for the -Dhttp.proxyPort=<port>
-Dhttp.nonProxyHosts=<nonProxyHosts> options, i'm looking for a switch
between the different defined proxies.



*Regards*


PS: here is the Stackoverflow question
<https://stackoverflow.com/questions/67022473/how-to-make-maven-not-use-the-first-proxy-in-settings-xml>

Reply via email to