如何创建Spring Boot项目?
一、在springboot官网创建
在这里直接附上创建springboot的网址:
https://start.spring.io/
输入网址进入springboot创建页面 选择想要创建的项目版本以及jdk版本等信息即可创建
二、创建maven项目加入springboot依赖
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.6.0</version> <relativePath/> <!-- lookup parent from repository --> </parent>
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency>
<!-- 添加Spring boot编译插件 --> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin>
三、在idea选择快速创建springboot
File–>New–>Project 点击Next 点击Next,选择Spring Web依赖 再点击Next,点击Finsh,就可以创建一个Spring Boot项目了。