Maven小白系列-05Maven统一版本管理

Maven小白系列,我们会分为几个部分?


01 添加依赖并打包

02 添加本地jar包并打包

03 将本地jar包导入本地maven库

04 springboot打包jar和war

05 Maven统一版本管理


接下来,我们开始第五部分的内容

通常情况下,我们会将一个项目分层使用,今天我们是讲解MAVEN使用,我不负责分层,一切从简

A项目,有BC两个子模块,B引用C


一、新建MAVEN项目

image

image

image

image

package改成pom

image


新建B、C两个子模块

image

image

image

二、统一版本管理

在A的POM中,新建<dependencyManagement></dependencyManagement>标签对

image

如果是SpringBoot的统一版本写法

         <!-- SpringBoot -->
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-dependencies</artifactId>
               <version>2.2.5.RELEASE</version>
               <type>pom</type>
               <scope>import</scope>
           </dependency>

image

三、子模块使用

子模块中使用,子模块中就不需要<dependencyManagement></dependencyManagement>标签了

直接使用<dependencies></dependencies>

image

打包就略了,看之前的博客

posted @ 2020-06-29 10:36  大师兄法号随缘  阅读(356)  评论(0编辑  收藏  举报