@@ -5,13 +5,13 @@ param($JAVA_HOME, $MAVEN_HOME)
55
66# ---------------------------------------------- 全局变量 ------------------------------------------------
77# 当前脚本的版本号
8- $SCRIPT_VERSION = ' 6 '
8+ $SCRIPT_VERSION = ' 1 '
99# 项目名称
1010$PROJECT_NAME = ' -'
1111# 项目版本
1212$PROJECT_VERSION = ' -'
13- # 构建成品输出位置 默认为当前目录下的 built 文件夹
14- $OUTPUT_URL = Join-Path (Get-Location ) ' built '
13+ # 构建成品输出位置 默认为当前目录下的 build 文件夹
14+ $OUTPUT_URL = Join-Path (Get-Location ) ' build '
1515
1616# 设置标题
1717function SetTitle ($title )
@@ -23,7 +23,7 @@ function SetOutputUrl()
2323{
2424 while ($true )
2525 {
26- $tempOutputUrl = Read-Host ' 请输入打包文件的输出目录 留空为当前目录下的 built '
26+ $tempOutputUrl = Read-Host ' 请输入打包文件的输出目录 留空为当前目录下的 build '
2727 if ($tempOutputUrl -ne ' ' )
2828 {
2929 $script :OUTPUT_URL = $tempOutputUrl
@@ -102,7 +102,6 @@ function SetTempEnvironmentVariables()
102102 $PathVariables = $PathVariables + $MAVEN_HOME + ' ;'
103103 }
104104 $env: Path = $env: Path + $PathVariables
105- $env: JAVA_TOOL_OPTIONS = ' -Dfile.encoding=UTF-8 -Duser.language=zh'
106105}
107106
108107function ToZip ($from , $to )
@@ -125,7 +124,7 @@ function ShowSuccess()
125124 mvn clean
126125 Write-Host ' 打包成功' - ForegroundColor Green
127126 Write-Host " 后台项目是$OUTPUT_URL \$PROJECT_NAME -$PROJECT_VERSION .jar" - ForegroundColor Green
128- Write-Host " 启动脚本是$OUTPUT_URL \startup-$PROJECT_VERSION .bat" - ForegroundColor Green
127+ Write-Host " 启动脚本是$OUTPUT_URL \startup-$PROJECT_NAME - $ PROJECT_VERSION .bat" - ForegroundColor Green
129128 pause
130129 explorer $OUTPUT_URL
131130}
@@ -172,11 +171,10 @@ function CreateWindowsStartupScript()
172171 " @echo off
173172CHCP 65001
174173TITLE $PROJECT_NAME -$PROJECT_VERSION
175- SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 -Duser.language=zh
176174java -jar $PROJECT_NAME -$PROJECT_VERSION .jar"
177175 # 将内容写入文件
178176 $UTF8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
179- [System.IO.File ]::WriteAllText(" $OUTPUT_URL \startup-$PROJECT_VERSION .bat" , $ScriptContent , $UTF8NoBomEncoding )
177+ [System.IO.File ]::WriteAllText(" $OUTPUT_URL \startup-$PROJECT_NAME - $ PROJECT_VERSION .bat" , $ScriptContent , $UTF8NoBomEncoding )
180178}
181179
182180function BuildProject ()
0 commit comments