【Spring boot】【01】【初始化环境的使用和项目创建】

本文详细介绍了如何在Eclipse编辑器中使用Springtools创建SpringBoot项目,包括Springtools的安装、项目配置及依赖管理,以及如何运行SpringBoot应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

spring boot 项目创建

你好! 这是你第一次使用 eclipse编辑器 创建spring boot项目,我们后续的所有项目都基于eclipse进行编译操作,由于本人长年使用eclipse形成习惯,当然你也可以使用IDEA最好的编辑器着手开发spring boot的项目。

Spring tools的安装

  1. 打开eclipse 编辑器,打开Help->Eclipse Marketplace->如图:

在这里插入图片描述

  1. 搜索 Spring tools* 功能。

如图:
选择第一个点击安装
选择安装就可以。

创建项目

1.点击项目右键选择“Spring Starter Project

如图:
在这里插入图片描述

2.点击“Next

可以选择Packing

3.一般默认的Spring boot 项目为**.Jar**

在这里插入图片描述

3.点击"Next"期间这个界面是你要选择的配置类,我们可以忽略,如图

在这里插入图片描述

4.点击"Finish"继续操作,一个Spring boot项目创建成功,结构,如图:

在这里插入图片描述

5.项目创建成功后的pom文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.1.2.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.qjc</groupId>
	<artifactId>spring-boot-cretate</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>spring-boot-cretate</name>
	<description>Demo project for Spring Boot</description>

	<properties>
		<java.version>1.8</java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</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>

</project>

6.启动项目

点击右键-》Run As-》Spring Boot App 项目启动
点击右键穹顶
可以看到日志,如图:


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.2.RELEASE)

2019-01-24 11:28:35.803  INFO 19312 --- [           main] com.qjc.SpringBootCretateApplication     : Starting SpringBootCretateApplication on DESKTOP-580CUKI with PID 19312 (D:\J2EEBoot\eclipse-boot\spring-boot-cretate\target\classes started by joe in D:\J2EEBoot\eclipse-boot\spring-boot-cretate)
2019-01-24 11:28:35.807  INFO 19312 --- [           main] com.qjc.SpringBootCretateApplication     : No active profile set, falling back to default profiles: default
2019-01-24 11:28:36.235  INFO 19312 --- [           main] com.qjc.SpringBootCretateApplication     : Started SpringBootCretateApplication in 0.671 seconds (JVM running for 1.332)

7.项目源码地址
https://github.com/joecheng521/springboot/tree/master/spring-boot-cretate

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

程序员老乔

多多鼓励,多多参与

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

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

打赏作者

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

抵扣说明:

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

余额充值