1

Currently I have setup the maven proxy(For a Spring Boot maven wrapper) up like:

MAVEN_OPTS=-Dhttp.proxyHost=proxy.company.com -Dhttps.proxyHost=proxy.company.com -Dhttp.proxyPort=8080 -Dhttps.proxyPort=8080 -Dhttp.proxyUser=myUserName -Dhttp.proxyPassword=MyEpicPassword

While I can see in my logs that my proxy host and port are being accepted, I am getting AuthenticationRequired failures.

[WARNING] Could not transfer metadata org.springframework.cloud:spring-cloud-build:1.2.2.BUILD-SNAPSHOT/maven-metadata.xml from/to java-releases (http://download.java.net/maven/2): Not authorized by proxy , ReasonPhrase:authenticationrequired.

Additional Information:

I am leveraging a maven wrapper project so I do not have direct access to a settings.xml file that I am aware of to opt for xml based proxy configuration. However, if that is possible I am already familiar with how to configure my settings.xml file with a proxy.

This question is not a duplicate because it is focused on Authentication via Maven Opts.

Matthew Fontana
  • 3,790
  • 2
  • 30
  • 50
  • What kind of authentication does your proxy support. I have had similar errors behind NTML proxies before. – RudolphEst Jan 06 '17 at 12:46
  • I know I have full proxy support via the settings.xml configuration. I am having trouble working out how to set the username and password via command line arguments – Matthew Fontana Jan 06 '17 at 13:13
  • I think you misunderstand the question. What I mean is, what kind of proxy are you trying to connect to? Maven (or more accurately Java) is not good at connecting to proxies provided by Miscrosoft Servers (NTLM). – RudolphEst Jan 06 '17 at 13:16
  • I am not certain the of the type. How can I check that? – Matthew Fontana Jan 06 '17 at 13:43
  • I am afraid that I do not know how to check. I usually ask around when I join a new company. If your proxy user and password is the same as your windows domain user and password, chances are you are behind an proxy that uses NTML for authentication. – RudolphEst Jan 06 '17 at 13:49
  • Possible duplicate of [Maven behind a auto-generated proxy](http://stackoverflow.com/questions/23539048/maven-behind-a-auto-generated-proxy) – RudolphEst Jan 06 '17 at 13:51
  • What I see is that those options should be moved into the settings.xml and do the configuration in settings.xml and do not use it in MAVEN_OPTS... – khmarbaise Jan 06 '17 at 18:27

1 Answers1

0

When your company uses NTLM authentication on the proxy, you may find that you have problems like these.

I usually set up as per this post when that is the case.

Other options are to set the username and password as described in this thread, but I've never had much lastick luck with this option.

Community
  • 1
  • 1
RudolphEst
  • 1,240
  • 13
  • 21