Maven里也就是pom.xml改下:
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.7.18</version>
</dependency>
<properties>
<java.version>1.8</java.version>
</properties>
也可以自己部署一个spring初始化工具,然后Idea里选一下http://127.0.0.1:8080 或者该容器所在IP:8080
docker run -p 8080:8080 pan0x744/spring-initializr-java-8