1

In a work context I have inherited a Springboot-Maven project that aims to create a rest API. Having the previous snapshot (.jar built by maven) I can run it with visual studio code ( that what used the previous dev ). Unfortunatly I can not maven installthe project from VS code or command line in terminal, as I run into proxy problems, I tried to configure it into {user}/.m2/settings.xml but it does not seem like VS code is taking it into account. But here is the trick: Eclipse did find it and can use it. (So the settings.xml is correctly written and can be used).

Now I am trapped in a situation where I build with Eclipse and run the .jar with Visual studio code, can you see the problem ?

When running mvnw -s {user}/.m2/settings.xml install -f pom.xml(same result with or without the settings.xml) I get the following error:

Found "C:\Users\\Documents*.mvn\wrapper\maven-wrapper.jar" Exception in thread "main" java.net.ConnectException: Connection timed out: connect at java.base/java.net.DualStackPlainSocketImpl.connect0(Native Method)

I am asking for help as I am new to Maven and would like to understand how can Eclipse use correctly my settings.xml and I can not seem to make use of it.

Thanks for reading.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Yoann
  • 43
  • 6
  • 1. you are using maven-wrapper (https://www.baeldung.com/maven-wrapper, https://github.com/takari/maven-wrapper) ... 2. According to https://stackoverflow.com/a/44500269/592355 (this is "jhipster" related, but same problem) ...maven-wrapper doesn't pick up the proxy settings (from settings.xml) ... please try to apply the answer to your case/use "bare maven" (full installation, no wrapper) – xerx593 Jan 29 '20 at 15:53
  • Great that post provided me solution instantly. To solve this I created a *.mvn/jvm.config* with the appropriate parameter for Maven wrapper to use it. – Yoann Jan 29 '20 at 16:08
  • Feel free to post (& accept) your own answer! ;) ..and welcome to [so]! – xerx593 Jan 29 '20 at 16:11

0 Answers0