1.在pom中添加依赖

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

2.修改Application.java 使用实现接口CommandLineRunner

package com.itstudy.springbootconsole;

import org.springframework.boot.Banner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
public class Application implements CommandLineRunner { public static void main(String[] args) { SpringApplication app = new SpringApplication(Application.class);
app.setBannerMode(Banner.Mode.OFF);
app.run(args); } public void run(String... arg0) throws Exception {
    //这里添加代码
} }

最新文章

  1. java注释指导手册
  2. 自动化测试selenium+java 第一章
  3. 【题解】【数组】【Leetcode】Merge Sorted Array
  4. 阿里云开放服务oss的api
  5. zigbee
  6. OC基础-day05
  7. POJ 1873 The Fortified Forest
  8. crontab问题处理
  9. 创建python虚拟环境如果速度很慢
  10. bootloaderd的再解析
  11. Inotify+Rsync实现Linux服务器文件同步
  12. Spark Streaming和Kafka整合保证数据零丢失
  13. 【原创】研发应该懂的binlog知识(下)
  14. iOS Message from debugger: Terminated due to memory issue ~解决方法
  15. 虚拟机克隆之后,网卡名称从eth0变成eth1之后的解决办法
  16. WEB 安全学习 一、mysql 注入漏洞
  17. Centos7升级新内核
  18. Intellij Idea搭建Spark开发环境
  19. 使用node新建一个socket服务器连接Telnet客户端并且进行输入的显示
  20. 执行automake时报错 error while making link: Operation not supported

热门文章

  1. ubuntu16.04 下安装jdk
  2. 【LuoguP3329&amp;4123】[ZJOI2011]最小割&amp;[CQOI2016]不同的最小割
  3. 微信小程序-坑1-await-async
  4. mysql 语句积累
  5. 2,ActiveMQ-入门
  6. Oulipo【Hash】
  7. 【bzoj3566】 [SHOI2014]概率充电器
  8. 【Java】使用@Valid+BindingResult进行controller参数校验
  9. php curl文件上传
  10. Redis 序列化方式StringRedisSerializer、FastJsonRedisSerializer和KryoRedisSerializer