@echo off
:select
echo *********************************************************************************************
echo 1:開戶 2:銷戶 3:賬戶凍結 4:賬戶止入 5:賬戶止出
echo 6:賬戶解凍 7:賬戶解除止入 8:賬戶解除止出
rem echo 10:新增科目 11:修改科目
echo 20:新增分錄規則 21:修改分錄規則
echo 30:資金凍結 31:資金解凍
echo 40:分錄處理
echo *********************************************************************************************
set /p choice=請輸入一個功能代碼:
if /i %choice%==1 goto run
if /i %choice%==2 goto account
if /i %choice%==3 goto account
if /i %choice%==4 goto account
if /i %choice%==5 goto account
if /i %choice%==6 goto account
if /i %choice%==7 goto account
if /i %choice%==8 goto account
if /i %choice%==20 goto run
if /i %choice%==21 goto run
if /i %choice%==30 goto run
if /i %choice%==31 goto run
if /i %choice%==40 goto run
echo 輸入無效請重新輸入.
goto select
:run
echo 功能處理開始...
start jar.bat %choice%
goto select
:account
echo 功能處理開始...
set /p id=請輸入一個賬戶的id:
start jar.bat %choice% %id%
goto select
調用另外的bat文件如下
java -jar my-spring-app.jar %1 %2
exit
外另附上如何用maven構成一個可執行的spring jar包
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>my-spring-app</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.******.*****.acc.Main</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.tooling</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<mainClass>用來指定程序的入口
用maven的install 命令執行後可生成一個叫 my-spring-app.jar 的包
直接用java -jar my-spring-app.jar 就可以運行了。