microsoft / vscode-maven

VSCode extension "Maven for Java"
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven
Other
181 stars 88 forks source link

Unable to create Maven Java project in VS Code #941

Closed post-war closed 1 year ago

post-war commented 1 year ago

I am unable to create Maven java project from archetype in VS code. I have given below the error I get. I have searched and found many have reported the same since 2019. I have tried all the suggested solutions but to no avail. image I am using Windows 10.

Eskibear commented 1 year ago

You can copy the full command (cmd.exe /c ""......my proj""), run it in an external cmd prompt. See if that would work or any error?

post-war commented 1 year ago

I tried after removing outer quotes, but different errors. ( fyi, I can create Maven project in another pc without errors) I think the command is correct. It starts executing but gets into some errors, full log is below.

Exception in thread "main" java.net.UnknownHostException: repo.maven.apache.org at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:293) at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:203) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:189) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1572) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1500) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268) at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:90) at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:76)
at org.apache.maven.wrapper.Installer.createDist(Installer.java:72) at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:121)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:61)

post-war commented 1 year ago

No firewall issue as I can reach https://repo.maven.apache.org/ from browser

Eskibear commented 1 year ago

I don't see such error, using the same mvnw embedded in this extension, as below. From the error log you provided, it's likely related to your networking status, e.g. are you behind some proxy/VPN, or some self-issued certs required, etc... The root cause should be that "repo.maven.apache.org" failed to be resolved. I myself guess it's related to DNS/SSL certs.

image

Eskibear commented 1 year ago

Or you can download a Maven distribution on your own, and add it into PATH env. use mvn to run almost the same command in CMD, see if it works. If it works, we have a setting maven.executable.path for you to specify.

post-war commented 1 year ago

Thanks, DNS/SSL cert must be the likely cause. I will try with mvn directly.

Eskibear commented 1 year ago

I'm closing it as it's probably networking issue. Feel free to reopen it if anything new is found.

BharathKalva69 commented 9 months ago

I am unable to create Maven java project from archetype in VS code. I have given below the error I get. I have searched and found many have reported the same since 2019. I have tried all the suggested solutions but to no avail. image I am using Windows 10.

I am facing the same somebody help me to solve this please, this error is haunting me, and my project dead is approaching (panik!). thanks

BharathKalva69 commented 9 months ago

You can copy the full command (cmd.exe /c ""......my proj""), run it in an external cmd prompt. See if that would work or any error?

Did it, nothing happened.

sindhiyas commented 5 months ago

I am facing the same issue as mentioned above. can somebody please help with some solutions. thanks