spring boot bilibili
idea找不到spring boot插件plugin,找不到spring Initializr
安装了付费版就OK,社区版本是没有的
springboot 约定大于配置,开发人员专注逻辑
spring cloud(云服务,微服务),sprig boot 相互成就;
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.5.1
com.example
demo
0.0.1-SNAPSHOT
demo
Demo project for Spring Boot
1.8
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-maven-plugin
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/hello")
public class Hello {
@RequestMapping("/say")
public String sayHi(){
return "Hello World";
}
}
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
int a =1;
System.out.println(123);
SpringApplication.run(DemoApplication.class, args);
}
}
端口占用问题:
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210630174549478.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM4OTk4MjEz,size_16,color_FFFFFF,t_70