Spring Boot 3 整合 H2 快速示例

这里是在一个多层级项目中搭建一个Spring的子模块项目用于演示 H2与Spring Boot的整合,单独的Spring Boot则更为简单。需要注意:Spring Boot 3 整合H2 相比Spring Boot 2有细微差别。

版本

  • Spring Boot 3.0.5
  • 开发IDE : Spring Tool Suite 4

步骤

  1. 父项目pom.xml中配置的Spring Boot的版本
  <!--  配置依赖版本 -->
  <dependencyManagement>
     <dependencies>
		 <dependency>
		        <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>3.0.6</version>
                <type>pom</type>
                <scope>import</scope>			 
		</dependency>
	 </dependencies>
  </dependencyManagement>
  1. 在父项目下增加一个模块

在这里插入图片描述

勾选创建一个简单的项目, 也就是使用任何项目骨架。<

猜你喜欢

转载自blog.csdn.net/oscar999/article/details/131819805