最近在学习springboot,先从创建项目开始,一般项目都是一个项目下会有多个模块,这里先创建一个demo的实例
期望的项目结构如下 
demo-parent
    —-demo-api 

    —-demo-core

    —-demo-web

一、创建空Maven项目

首先打开IDEA,点击“Create New Project”

基于maven使用IDEA创建springboot多模块项目

选择Maven,点击下一步 
基于maven使用IDEA创建springboot多模块项目
填写信息,直到完成项目创建

基于maven使用IDEA创建springboot多模块项目

创建成功后 

基于maven使用IDEA创建springboot多模块项目

删除src文件夹,在pom文件中添加

<packaging>pom</packaging>

基于maven使用IDEA创建springboot多模块项目

二、创建Springboot项目模块

在根项目上点击右键,选择Module

基于maven使用IDEA创建springboot多模块项目

选择Spring Initializr

基于maven使用IDEA创建springboot多模块项目

填写信息 ,这里packaging选war格式
基于maven使用IDEA创建springboot多模块项目

选择依赖项 
基于maven使用IDEA创建springboot多模块项目

完成向导,demo-web是新建出来的项目

基于maven使用IDEA创建springboot多模块项目

依次再创建demo-core模块、demo-api模块,packaging都为jar,最终格式如下:

基于maven使用IDEA创建springboot多模块项目

 

转载于:https://my.oschina.net/jzgycq/blog/1607683

相关文章:

  • 2021-06-21
  • 2021-06-18
  • 2022-12-23
  • 2021-08-06
  • 2021-11-26
  • 2021-07-21
  • 2022-12-23
  • 2021-04-18
猜你喜欢
  • 2022-12-23
  • 2021-05-31
  • 2021-10-30
  • 2021-11-19
  • 2022-02-10
  • 2022-01-20
相关资源
相似解决方案