-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maven resolution fails behind proxy #32
Comments
Hi @lerad, thanks for raising the issue. I don't know too much when it comes to using proxies so I'm not sure how to test this myself. I would appreciate it if you could try a couple things and let me know if/how any of them work. The kernel is using shrinkwrap resolvers to resolve dependencies and there is a section in the README about system prperties. Specifically the The 2nd thing I would appreciate you giving me feedback on is running a cell with the following: import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.jboss.shrinkwrap.resolver.api.maven.strategy.TransitiveStrategy;
Maven.configureResolver()
.withClassPathResolution(true)
.withMavenCentralRepo(true)
.fromFile("/path/to/settings.xml")
.resolve("org.knowm.xchart:xchart:jar:3.5.2")
.using(TransitiveStrategy.INSTANCE)
.asList(File.class); and replacing the I am aiming to tackle a couple issues this weekend and would appreciate the feedback by then. As this will likely require some additional documentation, any extra information you can provide would help immensely in writing it up for others that need to work through proxies. Thanks! |
Thank you for the fast reply. I tried with a Maven configuration file, however the error persists. With the settings.xml I receive as output from the cell:
I tried the same code in IntelliJ and stepped through it with the java debugger. The proxies are initially loaded correctly, I can see a them in However deeper down in the call chain in org.apache.maven.wagon.providers.http.LightweightHttpWagon somehow the proxy information seem to be lost. The exception than happens in Probably this is an issue of those libraries? |
Apologies for the silence on this issue. I have given the debugger a try and indeed the wagon being used does appear to never take note of the proxy. Feel free to ignore the ramblings below, they are more for notes but in case you are interested I have included them. Hopefully this week I can get a chance to implement something. I've tracked it down to I believe the In In I think a custom |
I'm experiencing the same error without a proxy. Any hints on how to debug this? The error message I get in the console specifies that an artifact failed to transfer but requesting the resource manually works fine. |
Despite this failing on two completely different networks yesterday, I ran the same thing again today without issues so things are working fine for me now. I'd still be interested in hearing suggestions for debugging in the future. |
@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. |
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 :) |
The %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:
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.
The text was updated successfully, but these errors were encountered: