一、手动创建springboot项目
- 1.新建maven项目
- 2.导入spingboot的父工程和web工程
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
- 3.编写启动类HelloApplilcation(在com.wei目录下)
@SpringBootApplication
public class HelloApplication {
public static void main(String[] args) {
SpringApplication.run(HelloApplication.class,args);
}
}
- 4.创建测试类,在com.wei.controller目录下创建helloWrodController.java文件
@RestController
public class HelloWordController {
@RequestMapping("/hello")
public String Hello(){
return "Hello Spring Boot";
}
}
Spirnboot快速构建