基于Maven创建多模块的Spring Boot项目

使用 Spring Boot的初始化器等创建Spring Boot项目时,需要在pom.xml指定该项目的父项目是 spring-boot-starter-parent。

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>3.0.6</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

如果要创建一个多模块的项目,每个模块都是一个单独的Spring Boot项目,要怎么处理呢?
在Maven中的多模块项目, 需要创建一个pom类型的父项目,每个模块需要指定parent为这个, 那么如何为每个模块配置Spring Boot 呢?

本篇使用Spring Tools Suite(Spring 官方提供包含Spring Boot开发插件的Eclipse)创建一个多模块的Spring Boot 项目。

创建步骤

首先创建一个父项目

  1. 点击"File"菜单, 选择New > Maven Project

在这里插入图片描述

  1. 创建一个简单的项目

猜你喜欢

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