Skip to content

Commit

Permalink
用-classpath方式启动springboot
Browse files Browse the repository at this point in the history
  • Loading branch information
yajuhua committed Apr 30, 2024
1 parent ddc61d6 commit 4bf86e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-latest-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
- name: Build with Maven
run: |
mvn -B package --file pom.xml
cp target/app.jar platform/windows/
unzip target/app.jar
cp target/BOOT-INF/classes platform/windows/
cp target/BOOT-INF/lib platform/windows/
zip -r windows.zip platform/windows/
# 获取 Maven 项目版本
Expand Down
19 changes: 17 additions & 2 deletions platform/windows/start.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
@echo off
setlocal enabledelayedexpansion

set PWD=%~dp0
set JAVA=%PWD%jre8/bin
set DATA=%PWD%data
set "PATH=%JAVA%;%PWD%;%PATH%"
java -version
set "directory=%PWD%\lib"
set "classpath=%PWD%;classes"

rem 遍历指定目录下的所有文件
for /r "%directory%" %%I in (*) do (
set "classpath=!classpath!;%%~fI"
)

rem 去掉开头的分号
if defined classpath (
set "classpath=!classpath:~1!"
)
start /b %PWD%aria2c.exe --conf-path=%PWD%aria2.conf > aria2.log
echo "aria2RPC start"
chcp 65001
java -jar -Dfile.encoding=utf-8 app.jar --podcast2.data.data-path=%DATA%
java -Dfile.encoding=utf-8 -classpath "%classpath%" -Dpodcast2.data.data-path=%DATA% io.github.yajuhua.podcast2.Podcast2Application
endlocal

0 comments on commit 4bf86e4

Please sign in to comment.