多模块项目搭建

1.父项目pom文件编辑

    <!--1.父工程 添加pom格式-->
<packaging>pom</packaging> <!--定义子模块-->
<modules>
<module>walker-service</module>
<module>walker-utils</module>
<module>walker-api</module>
</modules>
  • maven打包插件:
    <plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.version}</version>
</plugin>
<!-- maven打包-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>true</skipTests> <!--默认关掉单元测试 -->
</configuration>
</plugin>
</plugins>
常用依赖与版本:
 

     1.8
2.7.12
1.2.4
8.0.30
1.2.17
2.0.8
2.9.2
2.2.2
5.8.10 org.springframework.boot
spring-boot-starter
${spring.version} org.springframework.boot
spring-boot-starter-web
${spring.version} org.springframework.boot
spring-boot-starter-test
${spring.version}
test com.alibaba
druid-spring-boot-starter
${druid.version} org.mybatis.spring.boot
mybatis-spring-boot-starter
${mybatis.version} mysql
mysql-connector-java
runtime
${mysql-connector-java.version} com.alibaba.fastjson2
fastjson2
${fastjson.version} cn.hutool
hutool-all
${hutool.version} com.github.pagehelper
pagehelper-spring-boot-starter
1.4.3

2.创建子模块

本文以service、utils、api为例

  1. utils::删除多余部分,添加父项目,打包类型为jar

     <parent>
    <groupId>com.code</groupId>
    <artifactId>walker</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    </parent>
    <packaging>jar</packaging>
  2. api:添加父项目,打包类型为jar,添加utils依赖

        <parent>
    <groupId>com.code</groupId>
    <artifactId>walker</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    </parent>
    <packaging>jar</packaging>
    <dependencies>
    <dependency>
    <groupId>com.code.walker</groupId>
    <artifactId>walker-utils</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    </dependency>
    </dependencies>
  3. service:添加父项目,打包为jar,添加utils、api依赖,添加父项目中存在的依赖时可不写依赖version

        <parent>
    <groupId>com.code</groupId>
    <artifactId>walker</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    </parent> <packaging>jar</packaging> <dependency>
    <groupId>com.code.walker</groupId>
    <artifactId>walker-utils</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
    <groupId>com.code.walker</groupId>
    <artifactId>walker-api</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    </dependency>
    service其他常用依赖:




    ​ com.code.walker
    ​ walker-utils
    ​ 0.0.1-SNAPSHOT


    ​ com.code.walker
    ​ walker-api
    ​ 0.0.1-SNAPSHOT


    ​ org.springframework.boot
    ​ spring-boot-starter-web


    ​ org.springframework.boot
    ​ spring-boot-starter-test
    ​ test

    ​ com.alibaba
    ​ druid-spring-boot-starter

    ​ org.mybatis.spring.boot
    ​ mybatis-spring-boot-starter

    ​ mysql
    ​ mysql-connector-java
    ​ runtime


    ​ com.alibaba.fastjson2
    ​ fastjson2



    ​ cn.hutool
    ​ hutool-all



    ​ com.github.pagehelper
    ​ pagehelper-spring-boot-starter
    ​ 1.4.3


SpringBoot多模块项目搭建以及搭建基础模板的更多相关文章

  1. SpringBoot多模块项目打包问题

    项目结构图如下: 在SpringBoot多模块项目打包时遇见如下错误: 1.repackage failed: Unable to find main class -> [Help 1] 解决步 ...

  2. 2017-09-26 发布 SpringBoot多模块项目实践(Multi-Module)

    https://segmentfault.com/a/1190000011367492?utm_source=tag-newest 2017-09-26 发布 SpringBoot多模块项目实践(Mu ...

  3. 使用IDEA构建Spring-boot多模块项目配置流程

    使用IDEA构建Spring-boot多模块项目配置流程 1.创建项目 点击Create New Project 在左侧选中Spring Initializer,保持默认配置,点击下一步. 在Grou ...

  4. 记Spring搭建功能完整的个人博客「Oyster」全过程[其二] Idea中Maven+SpringBoot多模块项目开发的设计和各种坑(模块间依赖和打包问题)

    大家好嘞,今天闲着没事干开写写博客,记录一下Maven+SpringBoot的多模块设计和遇到的坑. 多模块设计 简单说明一下截止目前的需求: 需要RESTful API:对文章.标签.分类和评论等的 ...

  5. Java秒杀系统实战系列~构建SpringBoot多模块项目

    摘要:本篇博文是“Java秒杀系统实战系列文章”的第二篇,主要分享介绍如何采用IDEA,基于SpringBoot+SpringMVC+Mybatis+分布式中间件构建一个多模块的项目,即“秒杀系统”! ...

  6. springboot 多模块项目创建

    1.File>new>project  直接点击next 2.输入groupId  .artifactId 3.选择项目保存路劲  finish 4.成功创建多模块项目的根模块 5.创建子 ...

  7. 使用Gradle构建springboot多模块项目,并混合groovy开发

    idea设置本地gradle 打包: build.gradle //声明gradle脚本自身需要使用的资源,优先执行 buildscript { ext { springBootVersion = ' ...

  8. docker部署 springboot 多模块项目+vue

    之前学习了docker,今天就来试试将这个项目打包成docker镜像并通过运行一个镜像来运行项目.这里使用的项目是el-admin.是一个开源的springboot后端管理框架(前端vue),有兴趣的 ...

  9. IDEA SpringBoot多模块项目搭建详细过程(转)

    文章转自https://blog.csdn.net/zcf980/article/details/83040029 项目源码: 链接: https://pan.baidu.com/s/1Gp9cY1Q ...

  10. springboot多模块项目搭建遇到的问题记录

    废话不多说,直接上问题报错与解决方法. 问题报错一:(报错信息看下方代码) 问题原因:'com.company.logistics.service.company.CompanyService' 未找 ...

随机推荐

  1. 如何利用Excel/WPS表格制作智能成绩查询系统?

    要利用Excel或WPS表格制作智能成绩查询系统,可以按照以下步骤进行: 1. 设计数据库结构:确定需要存储的学生信息和成绩数据,包括姓名.学号.科目.分数等字段. 2. 创建数据表:在Excel或W ...

  2. 文心一言 VS 讯飞星火 VS chatgpt (154)-- 算法导论12.3 1题

    一.用go语言,给出 TREE-INSERT 过程的一个递归版本. 文心一言,代码不能运行: 下面是用 Go 语言实现一个递归版本的 TREE-INSERT 过程的代码: package main i ...

  3. C++学习笔记五:变量与数据类型(Auto类型)

    Auto 允许编译器自己来推断变量的类型,这种新功能是在c++11引入的.这个关键字结合for循环使用可以节省变量类型的重复输入.VS Code可以在鼠标移动到变量上之后直接显示变量的类型. auto ...

  4. Spring整合Quartz简单入门

    创建一个Web项目 导入相关jar包 <?xml version="1.0" encoding="UTF-8"?> <project xmln ...

  5. keystone和beaengine的编译

    编译Keystone 根据github的文档编译不出来,所以还是用CMake项目转成Visual Studio的项目来编译 1.下载源码 https://github.com/keystone-eng ...

  6. 华企盾DSC无缝替换亿赛通案例

    第一种方法无缝替换亿赛通案例 1. 把DSCClient.exe和DSCService.exe添加到亿赛通的加密控制策略中,关联类型设置为*.*|,配置为落地自动解密,包括其它程序也配置成落地自动解密 ...

  7. python 图片相关

    python 图片相关 本篇介绍两种方式来打开图片. 1: 使用matplotlib #!/usr/bin/python3 # -*- coding: UTF-8 -*- ""&q ...

  8. 【OpenCV】【Python】关于cv2.findContours()轮廓索引(编号)解析(RETR_TREE)

    在打算自己实现二维码的定位的时候,看到了相关博文的关于cv2.findContours返回的层级信息来定位三个"回"字从而达到定位二维码的目的,但是返回的hierarchy中的层级 ...

  9. MagicArray:像php一样,让Go业务代码不再卷!

    卷!一个字形容了当今码农行业的现状.一层一层的代码结构,一个一个dto,entity,vo,req,resp.这些对象越来越多,让码农们非常劳于奔命,加一个字段,改一个字段,影响面有多少.代码量也越来 ...

  10. 解密Prompt系列22. LLM Agent之RAG的反思:放弃了压缩还是智能么?

    已经唠了三章的RAG,是时候回头反思一下,当前的RAG是解决幻觉的终点么?我给不出直接的答案,不过感觉当前把RAG当作传统搜索框架在大模型时代下的改良,这个思路的天花板高度有限~ 反思来源于对RAG下 ...