Maven behind a auto-generated proxy

credentials are not the solution!

Solution to your problem is cntlm

steps to go

First step –>

Steps to get rid of these NTLM proxy Issues permanently.

  1. download and install cntlm
  2. edit cntlm.ini file in cntlm installation directory and make sure there is proxy of your network i.e. “Proxy NTLMPROXYHOST:PORT” e.g. Proxy 192.168.0.1:8080 (this is your network proxy from which you access internet!)
  3. DO NOT FORGET TO PUT your windows authentication credentials in cntlm.ini file just put your windows username ,your domain name ,your password .
  4. create environment variable(system variable) named CYGWIN with value “nodosfilewarning”(without quotes) if you don’t do so you are not able to even start cntlm! Secondly make two environment variables named http_proxy with value “http://localhost:3128” and https_proxy with value “http://localhost:3128“.
  5. go to start menu and click on cntlm folder then click on “start cntlm authentication proxy”(DO NOT FORGET TO MAKE “start cntlm authentication proxy” SHORTCUT A STARTUP PROGRAM OTHERWISE YOU CAN NOT ACCESS INTERNET AFTER REBOOT!! OR YOU NEED TO MANNUALLY START CNTLM PROXY EVERY TIME YOU REBOOT!!).
  6. open internet explorer –> Tools –> Internet Options –> Connections –> LAN settings
  7. tick mark both the checkbox under “proxy server” heading.
  8. put localhost or 127.0.0.1 in “address” text box and put 3128 under “port” text box(yes! you do not need your network proxy anymore as we already kept in cntlm.ini).
  9. click ok then again ok then close IE.

Thats it!! now you never see error related to NTLM proxy authentication failed or anything else not even in sbt or maven!!! CNTLM is quite fast as it is developed in C !!

Second step –>

start cntlm authentication proxy server

make sure your settings.xml file’s proxy look like this.

  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |-->
    <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>127.0.0.1</host>
      <port>3128</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
  </proxies>

Plese give me feedback if something does not work!

Leave a Comment