SpringBoot入门第一篇
创建SpringBoot项目的方式
第一种创建方式
创建项目步骤
1.1.1新建项目
选择依赖
最后创建项目,设置项目的目录位置
SpringBoot 项目目录结构
1.1.1.2 起始依赖
第二种创建方式
使用Springboot提供的初始化器,使用国内的地址:https://start.springboot.io
创建项目的步骤同上
第三种方式
使用maven想到创建项目
创建一个普通maven项目
修改项目的目录
创建springboot依赖
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
创建启动类,加入@SpringBootApplication注解
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
最后请大家多多支持我,好的文章来自粉丝们的鼓励,期待下一集的分享