Maven resolution fails behind proxy
See original GitHub issueThe %maven line magic code throws an error. I guess it is due to my proxy settings. It seems as if the resolver does not take into account the proxy settings? Is there a way to give the resolver a proxy configuration?
Command:
%maven org.knowm.xchart:xchart:3.5.2
or
%maven org.apache.commons:commons-math3:3.6.1
Result:
java.lang.RuntimeException: Exception occurred while running line magic ‘maven’: Unable to collect/resolve dependency tree for a resolution due to: Failed to collect dependencies at org.knowm.xchart:xchart:jar:3.5.2, caused by: Connection refused: connect at .lineMagic(#9:10) at .(#76:1)
I tried:
System.setProperty("http.proxyHost", proxyHost);
System.setProperty("https.proxyHost", proxyHost);
System.setProperty("http.proxyPort", proxyPort);
System.setProperty("https.proxyPort", proxyPort);
With this I can successfully make network communications, i.e. the proxy configuration works. E.g.:
URL url = new URL("http://www.example.org/");
InputStream in = url.openStream();
The above code works. However the maven resolution still fails.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
No problem, I understand. I was just using artifacts from Maven Central, so it seems unlikely to be any configuration issues. Anyway, things are working great now! I’ve been looking for something like IJava for a while and other than this initial hiccup, I’ve been pleasantly surprised with how well it works 😃
@michaelmior I’m working on a switch to use ivy (ivy-branch) which should allow using the system properties for setting up a proxy as well as having access to fix issues like these when they pop up. I should have some more time during the holidays to get some solid time in on pushing a few things out that I’ve been working on including this.
Failing transfer could be an https error with certificates? Could be issues with authentication of a private repo? Take a look at system variables on the working jvm and broken one and look for differences. It could also just be issues on the other side (remote is down?) or network issues? Also maven may be configured via global configurations that the magic doesn’t consider? I’m sorry that’s not much help, but I’m not really sure whats wrong 😕
As far as it suddenly working: if you managed to download the dependencies to your maven local repo, the magic would find them there and should not require connecting to the remote repo which might be what happened.