2.3.0
我从 Spring Initializr 到我的 Windows操作系统生成了一个简单的演示项目(版本) 8.1
,下面是基本结构
C:.
└───src
├───main
│ ├───java
│ │ └───com
│ │ └───example
│ │ └───demo
│ └───resources
└───test
└───java
└───com
└───example
└───demo
我尝试运行mvnw.cmd clean
并收到以下错误:
C:\Users\Downloads\demo\demo>mvnw.cmd clean
"}" was unexpected at this time.
下面是powershell中的相同输出
PS C:\Users\Downloads\demo\demo> .\mvnw.cmd clean
"}" was unexpected at this time.
PS C:\Users\Downloads\demo\demo>
我看到问题出现在mvnw.cmd
文件中的以下行中:
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%')"^
"}"
不知道我是否遗漏了什么。