maven applying proxy to nonProxyHost

2019-04-25 09:58发布

问题:

I have the following proxy set up in my settings.xml file

<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>someusername</username>
  <password>somepassword</password>
  <host>some.proxy.host.com</host>
  <port>5150</port>
  <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
</proxy>

But it still applies the proxy to my localhost, everytime I have to do something with localhost I have to change active to false.

回答1:

According to the docs[1] you can set

<useProxy>false</useProxy>

to prevent this from happening.

[1] http://dev.day.com/docs/en/cq/current/core/how_to/how_to_use_the_vlttool/vlt-mavenplugin.html#Common%20Parameters



回答2:

if you are looking to deploy on localhost

try this

<nonProxyHosts>*localhost*</nonProxyHosts>

should work