Skip to content
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

mvnw can't run on Windows #789

Closed
GuoRuiLv opened this issue Sep 11, 2018 · 13 comments
Closed

mvnw can't run on Windows #789

GuoRuiLv opened this issue Sep 11, 2018 · 13 comments

Comments

@GuoRuiLv
Copy link

Hi,when i build the project using mvnw ,get the error following:
image

Couldn't` find "G:\JDYUN\eclipse-jdt-ls\.mvn\wrapper\maven-wrapper.jar", downloading it ...
Downloading from: "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"
Exception calling "DownloadFile" with "2" argument(s): "The request was aborted: Could not create SSL/TLS secure channel."
At line:1 char:1
+ (New-Object Net.WebClient).DownloadFile('https://repo.maven.apache.or ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

Finished downloading "G:\JDYUN\eclipse-jdt-ls\.mvn\wrapper\maven-wrapper.jar"
Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
@fbricon
Copy link
Contributor

fbricon commented Sep 12, 2018

I found a similar report in http://mail-archives.apache.org/mod_mbox/calcite-dev/201808.mbox/%3CCAKQOUBjuayYX83q9fDTiSEf2tydRpSprMm1UnFjoF+gHzffgcA@mail.gmail.com%3E

Try replacing https://github.com/eclipse/eclipse.jdt.ls/blob/5f2f5521f7eb707d9019fdc39279c930dbc7a8df/mvnw.cmd#L135

with

powershell -Command "[Net.ServicePointManager]::SecurityProtocol =
[Net.SecurityProtocolType]::Tls12; (New-Object
Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"

If that works for you, I suggest you open a PR to fix https://github.com/takari/maven-wrapper/blob/master/mvnw.cmd#L135 upstream

@fbricon
Copy link
Contributor

fbricon commented Sep 12, 2018

@snjeza have you experienced that issue on windows? The wrapper jar needs to be missing

@fbricon fbricon changed the title mvnw can't to run mvnw can't to run on Windows Sep 12, 2018
@fbricon fbricon changed the title mvnw can't to run on Windows mvnw can't run on Windows Sep 12, 2018
@snjeza
Copy link
Contributor

snjeza commented Sep 12, 2018

@snjeza have you experienced that issue on windows? The wrapper jar needs to be missing

I have faced the following:

$ cd eclips.jdt.ls
$ rm -rf .mvn/wrapper/maven-wrapper.jar
$ cd ../vscode-java
$ npm run build-server

> [email protected] build-server C:\jbtgit\vscode-java
> gulp build_server

[00:57:10] Using gulpfile C:\jbtgit\vscode-java\gulpfile.js
[00:57:10] Starting 'build_server'...
Couldn't find "C:\jbtgit\eclipse.jdt.ls\.mvn\wrapper\maven-wrapper.jar", downloading it ...
Downloading from: "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"
Exception calling "DownloadFile" with "2" argument(s): "The underlying connecti
on was closed: An unexpected error occurred on a send."
At line:1 char:40
+ (New-Object Net.WebClient).DownloadFile <<<< ('https://repo.maven.apache.org/
maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar', 'C:\jbtgit\eclip
se.jdt.ls\.mvn\wrapper\maven-wrapper.jar')
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

A workaround:

$ cd ../eclipse.jdt.ls
$ ./mvnw -o clean package
$ cd ../vscode-java
$ npm run build-server

#789 (comment) doesn't help.

@lugreen Can you try to use the Git Bash cmd line.

@GuoRuiLv
Copy link
Author

@snjeza I have tried ,but i encountered other problems :

9dsoft@laosan-bjb MINGW64 /g/JDYUN/eclipse-jdt-ls (master)
$ ./mvnw -o clean package
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: org.eclipse.jdt.ls:org.eclipse.jdt.ls.core:0.25.0-SNAPSHOT @ G:\JDYUN\eclipse-jdt-ls\org.eclipse.jdt.ls.core\pom.xml
[INFO] Adding repository http://download.eclipse.org/scout/releases/4.0/testing
[INFO] Adding repository http://download.eclipse.org/tools/orbit/R-builds/R20170516192513/repository
[INFO] Adding repository http://download.eclipse.org/buildship/updates/e47/releases/2.x
[INFO] Adding repository http://download.eclipse.org/technology/m2e/milestones/1.9/1.9.1.20180906-0204
[INFO] Adding repository http://download.eclipse.org/eclipse/updates/4.9-I-builds
[INFO] Adding repository http://download.eclipse.org/lsp4j/updates/releases
[INFO] Adding repository http://download.eclipse.org/releases/photon
[INFO] Adding repository http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.0-2018-05-16_00-46-30-H11
[INFO] Resolving dependencies of MavenProject: org.eclipse.jdt.ls:org.eclipse.jdt.ls.core:0.25.0-SNAPSHOT @ G:\JDYUN\eclipse-jdt-ls\org.eclipse.jdt.ls.core\pom.xml
[ERROR] An error occurred while transferring artifact packed: osgi.bundle,org.eclipse.lsp4j,0.4.0.v20180425-1136 from repository http://download.eclipse.org/lsp4j/updates/releases/0.4.0:
[ERROR]    offline
[ERROR] Internal error: org.eclipse.tycho.repository.local.MirroringArtifactProvider$MirroringFailedException: Could not mirror artifact osgi.bundle,org.eclipse.lsp4j,0.4.0.v20180425-1136 into the local Maven repository.See log output for details. -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.repository.local.MirroringArtifactProvider$MirroringFailedException: Could not mirror artifact osgi.bundle,org.eclipse.lsp4j,0.4.0.v20180425-1136 into the local Maven repository.See log output for details.
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)

@snjeza
Copy link
Contributor

snjeza commented Sep 13, 2018

Try to add the following:

-Dtycho.disableP2Mirrors=true

See https://wiki.eclipse.org/Tycho/FAQ#How_do_I_disable_P2_mirrors.3F

@gns26
Copy link

gns26 commented Jan 15, 2019

Any update on this? I followed the fix by fbricon (adding TLS12) and that seems to work

@snjeza
Copy link
Contributor

snjeza commented Jan 15, 2019

Related issue: redhat-developer/vscode-xml#86 (comment)

@fbricon fbricon added this to the Mid January 2019 milestone Jan 15, 2019
@fbricon
Copy link
Contributor

fbricon commented Jan 15, 2019

I updated the wrapper scripts from the unreleased https://github.com/takari/maven-wrapper

@jarst
Copy link

jarst commented Feb 8, 2019

Commit fixing this issue:
takari/maven-wrapper@2528f41

@humbertocg
Copy link

Hi, i'm still getting this error on windows 10. everything is updated.

@jarek-przygodzki
Copy link

Hi, i'm still getting this error on windows 10. everything is updated.

.mvn\wrapper directory must exist and maven-wrapper.properties file must be present in it. mvnw.cmd can only download maven-wrapper.jar. As far as I understand, it's a workaround for projects that prohibit checking in binary data. Error reporting could be better.

@LeszekChojnacki
Copy link

LeszekChojnacki commented May 14, 2021

If you are using a VSCode, and you see this err in your consol you can try to set your terminal default to cmd

@dbnex14
Copy link

dbnex14 commented Jun 7, 2021

I am having the very same problem in 2021, VSC 1.56.2 on Windows 10. Could this have to do something with being behind a proxy?


C:\Windows>"\\path-to-my-project\mvnw.cmd" clean -f "\\path-to-my-project\pom.xml"
Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At line:1 char:282
+ ... pe]::Tls12; $webclient.DownloadFile('https://repo.maven.apache.org/ma ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException
 
Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants