1.springboot项目打包jar
===================
打包后,在如下目录:
这里打包的springboot的jar文件名为 api-0.0.1-SNAPSHOT.jar
2.编写bat启动springboot脚本
=====================
新建一个start.bat文件,start.bat文件的内容如下:
cd %~dp0
C:\jdk\jdk1.8.0_181\bin\java.exe -Dfile.encoding=utf-8 -jar api-0.0.1-SNAPSHOT.jar --server.port=81
cd %~dp0 表示切换到bat所在的目录下
-Dfile.encoding=utf-8 设置编码
–server.port=81 设置springboot访问端口为81
3.bat启动springboot
=================
假设api-0.0.1-SNAPSHOT.jar和start.bat文件,都放在d:\apidemo目录下
双击start.bat文件,会自动弹出控制台,信息大致如下:
D:\apid