SpringBoot入门第二集:创建springboot项目的三种方式

本文介绍了三种创建SpringBoot项目的方法。第一种是通过新建项目并选择依赖;第二种是利用Spring Boot初始化器,国内可访问https://start.springboot.io;第三种是创建普通Maven项目,添加相关依赖并配置启动类。每种方式都详细阐述了具体步骤,适合不同需求的开发者参考。
摘要由CSDN通过智能技术生成

创建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);
	}

}

最后请大家多多支持我,好的文章来自粉丝们的鼓励,期待下一集的分享

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI@独行侠

你的鼓励将是我最大的动力,感谢

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值