maven-wrapper icon indicating copy to clipboard operation
maven-wrapper copied to clipboard

[MWRAPPER-76] Error "{6}" was unexpected at this time (Windows 10)

Open jira-importer opened this issue 3 years ago • 2 comments

Svein opened MWRAPPER-76 and commented

Testes and i worked on this path: C:\tmp\New (2){6} folder\my-app57(2). The problem is the ')' character.

My solution is:

@setlocal EnableDelayedExpansion and !WRAPPER_JAR!.

 

@setlocal EnableDelayedExpansion
powershell -Command "&{"^
      "$webclient = new-object System.Net.WebClient;"^
      "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
      "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
      "}"^
      "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '!WRAPPER_JAR!')"^
      "}"
@endlocal
 

 


Affects: 3.1.1

jira-importer avatar Aug 24 '22 13:08 jira-importer

Artur commented

Thanks, we faced the same problem and are now using a manually patched version of mvnw.cmd with this fix

jira-importer avatar Nov 23 '22 11:11 jira-importer

James Z.M. Gao commented

Svein Artur- are the new type only-script also affected by this issue?

jira-importer avatar Apr 18 '24 01:04 jira-importer