From 4bf86e477c5857574f61051766a06e8852be9548 Mon Sep 17 00:00:00 2001 From: yajuhua Date: Tue, 30 Apr 2024 14:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8-classpath=E6=96=B9=E5=BC=8F=E5=90=AF?= =?UTF-8?q?=E5=8A=A8springboot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-latest-windows.yml | 4 +++- platform/windows/start.bat | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-latest-windows.yml b/.github/workflows/build-latest-windows.yml index 9712f72..a3efbac 100644 --- a/.github/workflows/build-latest-windows.yml +++ b/.github/workflows/build-latest-windows.yml @@ -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 项目版本 diff --git a/platform/windows/start.bat b/platform/windows/start.bat index 5a963ae..71b920f 100644 --- a/platform/windows/start.bat +++ b/platform/windows/start.bat @@ -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