步骤1: 在顶级父工程中添加springboot相关的pom配置
<!--springboot父级依赖,表示是一个是springboot项目 -->
<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.1.5.RELEASE</version>
	<relativePath />
</parent>
<!-- 设置utf-8 jdk1.8-->
<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<java.version>1.8</java.version>
</properties>
<!-- springboot依赖配置 -->
<dependencies>
	<!-- 1.指明使用springboot -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter</artifactId>
		<exclusions>
			<!-- 除去springboot自带的日志 -->
			<exclusion>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-logging</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
	<!-- 2.springboot中的内置的web模块-->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<!-- 3. springboot配置默认解析yml,使用xml,properties要解析到就需要引入 -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-configuration-processor</artifactId>
		<optional>true</optional>
	</dependency>
</dependencies>
步骤2:
 在工程的api接口模块下的resources创建application.yml文件
步骤3:
 1.创建一个包: com.one [根据自己项目创建]
 
2.创建一个springboot项目的启动类
 package com.one;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 /**
 * 启动类
 * @date: 2023年06月17日 15:39
 */
 @SpringBootApplication
 public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
 }
步骤4:
 1.创建一个controller包:com.one.controller
 2.在包下创建一个controller类
package com.one.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * 接口访问类
 */
@RestController //所有接口都是以json格式返回
public class HelloController {
    @GetMapping("/hello")
    public Object hello(){
        return  "hello word~";
    }
}
步骤5:最后运行启动类并,浏览器中输入:http://localhost:8080/hello
 



















