SpringBoot(12) SpringBoot创建非web应用
2024-08-24 07:16:42
在Spring Boot中,要创建一个非Web应用程序,实现CommandLineRunner并覆盖run()方法
@SpringBootApplication
public class SpringBootConsoleApplication implements CommandLineRunner { public static void main(String[] args) throws Exception { SpringApplication.run(SpringBootConsoleApplication.class, args); } //access command line arguments
@Override
public void run(String... args) throws Exception {
//do something
}
}
pom依赖:spring-boot-starter库
最新文章
- 【JavaScript】操作Canvas画图
- ms sql 2005和2008收缩日志的方法
- 字符串str功能介绍
- 手把手教你编写一个具有基本功能的shell(已开源)
- 空格和TAB键混用错误:IndentationError: unindent does not match any outer indentation level
- HDU 1171(01背包)
- Openstack之Swift架构(Cloud Storage)
- 直接运行PowerShell脚本
- sequel 连接不上,命令行能连上
- logstash-input-file 参数说明
- EditPlus仿Sublime配色方案(三种任你选择)
- TP-Link路由器的设置
- MSSQL 备份数据库还原
- Frequent Pattern (FP Growth算法)
- Joomla!3.7.0 Core SQL注入漏洞动态调试草稿
- 记录CentOS 7.4 上安装MySQL&;MariaDB&;Redis&;Mongodb
- mysql如何修改开启允许远程连接 (windows)
- MyBatis持久层框架学习之01 MyBatis的起源和发展
- Linux 下安装 Mongodb
- (转)c# String与StringBuilder