Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Plugin SDK proxy setting for https is not working (but http is)

J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2012

I've edited settings.xml with proxy entries for http and https as described in https://answers.atlassian.com/questions/20079/plugin-sdk-does-not-use-http-proxy and now when I run mvn commands some files are being downloaded - I think where there is a valid http link for them.

However, all https downloads are still failing but I can get to the files fine in a browser.

IE and Chrome's proxy settings are using the same proxy server for all protocols so I've just copied the http one and changed the protocol to https. Do I need to do something different with the https proxy in settings.xml?

Here's a sample of what I'm seeing (the http downloads are succeeding if the link is valid):

Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.pom
[WARNING] Unable to get resource 'org.apache.maven:maven-settings:pom:2.0.6' from repository atlassian-public (https://m2proxy.atlassian.com/repository/public): Error transferring file: Connection refused: connect
Downloading: file://D:\work\In-house\JIRA\atlassian-plugin-sdk-3.7.2/repository/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.pom
[INFO] Unable to find resource 'org.apache.maven:maven-settings:pom:2.0.6' in repository atlassian-plugin-sdk (file://D:\work\In-house\JIRA\atlassian-plugin-sdk-3.7.2/repository)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.pom

Downloading: https://m2proxy.atlassian.com/repository/public/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.pom
[WARNING] Unable to get resource 'org.apache.maven:maven-model:pom:2.0.6' from repository atlassian-public (https://m2proxy.atlassian.com/repository/public): Error transferring file: Connection refused: connect
Downloading: file://D:\work\In-house\JIRA\atlassian-plugin-sdk-3.7.2/repository/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.pom
[INFO] Unable to find resource 'org.apache.maven:maven-model:pom:2.0.6' in repository atlassian-plugin-sdk (file://D:\work\In-house\JIRA\atlassian-plugin-sdk-3.7.2/repository)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.pom

And here are the proxy entries in settings.xml:

    <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>192.168.200.100</host>
      <port>8080</port>
      <nonProxyHosts>*.mdsuk.com|*.limerick.mdsuk.com|*.10.100.0.*|192.168.200.141|192.168.200.125|192.168.201.5|192.168.201.6|10.200.0.0</nonProxyHosts>
    </proxy>
    <proxy>
      <active>true</active>
      <protocol>https</protocol>
      <host>192.168.200.100</host>
      <port>8080</port>
      <nonProxyHosts>*.mdsuk.com|*.limerick.mdsuk.com|*.10.100.0.*|192.168.200.141|192.168.200.125|192.168.201.5|192.168.201.6|10.200.0.0</nonProxyHosts>
    </proxy>

Could the firewall somehow be blocking Maven from downloading files whilst allowing IE and Chrome to download them? Or could there be a username and password required just for https?

5 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Deleted user February 23, 2012

It's because Maven is stupid and only reads the first proxy which has active set to true - so in your case it correctly configures the http proxy as you have put it first, but then ignores your https proxy settings.

What I did to get around this was just set up the https proxy settings.. And it eventually downloaded everything succesfully.

Or, you could try running the command with command line options like -Dhttp.proxyHost=exampleHost.example.org -Dhttp.proxyPort=80

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 23, 2012

If that's the case that would explain why using nexus worked, ie it proxies multiple repos on different schemes through to a single URL...

J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 23, 2012

Ooo now that sounds promising, I'll give it a go after the weekend. Thanks Iain.

2 votes
Deleted user March 11, 2012

While the maven executable mvn(.bat) uses the environment variable MAVEN_OPTS to pass parameters like the proxy system properties to the JVM, the atlas-scripts provided with the SDK don't respect an already set value and overwrite it.

But - there's help at hand: The atlas scripts use an environment variable ATLAS_OPTS that may be set with the proxy data and pass them through to maven.

The following excerpt from my .bashrc file works for me

export MAVEN_OPTS=" -Dhttps.proxyHost=192.168.98.100 -Dhttp.proxyHost=192.168.98.100 -Dhttps.proxyPort=3128 -Dhttp.proxyPort=3128"
export ATLAS_OPTS=$MAVEN_OPTS

christ March 26, 2013

And if you're on windows behind an NTLM proxy use Cntlm and point to it. Set ATLAS_OPTS as above and point to your Cntlm proxy. This is still just a work around. This is a defect - Atlas scripts don't respect maven env variables. I'll update the old issue. Help at hand would be fixing the defect.

1 vote
Ramiro Pointis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 27, 2012

After searching a lot I found a workaround:

You have to add

-Dhttps.proxyHost=my_proxy_host and -Dhttps.proxyPort=my_proxy_port

to

\<path to sdk>\apache-maven\bin\mvn.bat as described in

http://jira.codehaus.org/browse/MRM-1413

0 votes
J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2012

There is an outstanding bug which may be contributing to this: https://studio.atlassian.com/browse/AMPS-252.

I've managed to get around it with modifications to the corporate proxy and firewall to bypass the proxy for m2proxy.atlassian.com.

I haven't tried Jamie's Nexus suggestion but it was next on the list if our network guys couldn't fix it...

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2012

Ah, perhaps then I was able to do proxy authentication using nexus, but was struggling to do it with maven.

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2012

I had the same issue as you, I really can't remember why... possibly something to do with a corporate proxy server or my ISP or something. In frustration I set up a Nexus OSS instance which is really very easy, and it worked through that.

However at some point since the problem rectified itself... maybe a maven upgrade, or a firewall tweak or something. Strange one.

J Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2012

Thanks for the reply Jamie. I've found a colleague who's just started using Nexus (phew, wouldn't have known where to start!) and he'll give it a go in a couple of days - any pointers or tips here?

For now I'm getting around it by using a wifi network with no proxy but that's not ideal because I can't do my other work! Our IT Support suggested a couple of different ports and are now stumped.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2012

You just put in the atlassian maven repo url as a proxied repo, then change your settings to point to nexus. BTW, I have no idea why this worked, it's nonsensical, but it did...

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events