[SpringBoot/JavaEE]SpringBoot启动与停用的4种方式
SpringBoot 方式 启动 JavaEE 停用
2023-09-27 14:24:41 时间
SpringBoot版本: 2.1.6.RELEASE
1 启动
方式1 – IntelliJ IDEA - Windows
右键启动类SpringBootSampleApplication.java > Run “SpringBootSampleApplication#main()”
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820140904862-1547000044.png)
方式2 – Maven – Windows
E:
cd E:\Projects\SpringBootSample
mvn clean
mvn spring-boot:run (非后台运行)
或 mvn spring-boot:run > ./Applog.log & (后台运行)
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820141251521-549060763.png)
方式3 – Maven/JAR – AnyPlatform [推荐]
思路:mvn install编译生成出项目的jar,然后运行jar
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820140040923-1738198114.png)
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820141332589-648986986.png)
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820141349686-1108143573.png)
方式4 - Maven/Linux Shell - Linux [未亲测]
请参见: 正确、安全地停止SpringBoot应用服务: 部署为Unix/Linux Service -博客园
2 停用
方式1 – 命令行 – AnyPlatform
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820140226094-1700235372.png)
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820140254387-886572469.png)
方式2 – IDEA – Windows
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820140319538-1282325504.png)
方式3 – actuator – AnyPlatform [推荐]
利用端点管理器actuator,实现远程管理。
Actuator内容详见本文:端点管理actuator
![](https://img2020.cnblogs.com/blog/1173617/202008/1173617-20200820140517400-1557514060.png)
方式4 - Maven/Linux Shell - Linux [未亲测]
请参见: 正确、安全地停止SpringBoot应用服务: 部署为Unix/Linux Service -博客园
3 延申
nohup
nohup 英文全称 no hang up
(不挂起),用于在【系统后台】不挂断地运行命令,【退出终端】不会影响程序的运行。
nohup 命令,在默认情况下(非重定向时),会输出一个名叫 nohup.out
的文件到【当前目录】下。如果【当前目录】的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out
文件中
X 推荐文献
相关文章
- SpringBoot 分布式session共享方案(并且可实现session在多个项目中共享)
- SpringBoot 整合 freemarker
- eclipse中的springBoot项目 执行maven build 和maven install 报错
- springboot-day8-分布式异步执行
- springboot中model,modelandview,modelmap的区别与联系
- 精品springboot家政服务预订系统
- springBoot 入门(四)—— 使用 纯注解方式的junit整合测试
- springboot集成websocket的两种实现方式
- idea+springboot+freemarker热部署(转)
- 【Springboot】FastJson与Jackson全局序列化方式的配置和相关工具类
- idea springBoot 配置devtools实现热部署
- SpringBoot 定时任务实现方式
- 3种 Springboot 全局时间格式化方式,别再写重复代码了
- SpringBoot 整合SpringSecurity示例实现前后分离权限注解+JWT登录认证
- SpringBoot 四种获取ApplicationContext的方式
- SpringBoot 使用Logback日志框架
- SpringBoot 如何统计、监控 SQL运行情况?
- SpringBoot修改Redis序列化方式