文章目录
前言
不需要联网的springboot项目:
1.进入Spring官网
- Spring | Home

2.鼠标放到Projects

3.点击spring-boot

4.点击spring initializr
设置配置:如下图
5.击ADD DEPENDENCIES
- 添加依赖

6.生成压缩文件
- 点击GENERATE

7.打开压缩文件复制到工程目录下

8.导入工程

- File
- Project Structure

- 选择Modules
- 点击+号
- 选择Import Modules

- 点击需要导入的项目

- 选择Maven

9.创建控制类
package com.jkj.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/booksTwo")
public class BookController {
@GetMapping
public String ById(){
System.out.println("springboot_02 is running...");
return "springboot_02 is running...";
}
}
10.测试
- 在main方法类右键运行

