- 1.创建一个maven项目
- 2.导入依赖
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.9.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>
3 编写一个主程序
4 在我们的hellowordspringboot类当编写如下代码
package com.wubaba;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication//该注解用来标注一个主程序,说明是一个spring应用
public class HelloWordSpringBoot {
public static void main(String[] args) {
//运行springboot
SpringApplication.run(HelloWordSpringBoot.class,args);
}
}
5 到此为止Spring boot已经可以成功运行了,