SpringBoot - 无需idea联网的springboot项目

文章目录


前言

不需要联网的springboot项目:
在这里插入图片描述


1.进入Spring官网

  • Spring | Home

在这里插入图片描述

2.鼠标放到Projects

在这里插入图片描述

3.点击spring-boot

在这里插入图片描述

4.点击spring initializr

设置配置:如下图
在这里插入图片描述

5.击ADD DEPENDENCIES

  • 添加依赖
  • 在这里插入图片描述

6.生成压缩文件

  • 点击GENERATE

在这里插入图片描述

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

在这里插入图片描述

8.导入工程

在这里插入图片描述

  1. File
  2. Project Structure

在这里插入图片描述

  1. 选择Modules
  2. 点击+号
  3. 选择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方法类右键运行
    在这里插入图片描述
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43514330/article/details/125671307
今日推荐