springboot jar包 一鍵部署,開機自動啟動
檔案放置情況:
連結:https://pan.baidu.com/s/1WtlruXUjfTiZ5CnB7AKGnA 提取碼:ezgq 複製這段內容後開啟百度網盤手機App,操作更方便哦
jdk1.8.0_144:jdk資料夾
demo.jar:springboot打包的jar
vis-start.exe:winsw檔案
vis-start.xml:winsw配置
vis-start-install.cmd:將jar新增服務,並啟動
vis-start-uninstall.cmd: 將服務停止,並刪除服務
打不開安裝這個.exe:winsw需要依賴.net4,如電腦沒安裝.net,請先安裝改程式
Vis-start.xml配置
<configuration>
<!-- 系統服務ID,不能與其他系統服務名稱重複-->
<id>vis-springBootJar</id>
<!-- 系統服務顯示名稱 -->
<name>vis-springBootJar</name>
<!-- 服務描述 -->
<description>springBootJar Service</description>
<!-- java路徑 -->
<executable>%BASE%/jdk1.8.0_144/bin/java.exe</executable>
<!-- 命令引數,分行可以用多行'argument'標記 -->
<arguments>-jar %BASE%\demo.jar</arguments>
<!-- 日誌 -->
<logpath>%BASE%\logs</logpath>
</configuration>
執行命令:
啟動服務雙擊:vis-start-install.cmd
編輯vis-start-install.cmd
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit cd /d "%~dp0" vis-start.exe install vis-start.exe start
檢測:
停服務請使用:vis-start-uninstall.cmd
編輯vis-start-uninstall.cmd
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit cd /d "%~dp0" vis-start.exe stop vis-start.exe uninstall