Maven自定义Parent并集成SpringBoot

自定义Parent

1
2
3
4
5
6
<modelVersion>4.0.0</modelVersion>

<groupId>com.xx.xx</groupId>
<artifactId>xx-parent</artifactId>
<version>1.0.1</version>
<packaging>pom</packaging>

parent依赖管理集成SpringBoot

1
2
3
4
5
6
7
8
9
10
11
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

子项目继承和使用

继承Parent

1
2
3
4
5
6
7
8
9
10
<modelVersion>4.0.0</modelVersion>

<artifactId>xx-xx</artifactId>
<version>1.0-SNAPSHOT</version>

<parent>
<artifactId>xx-xx</artifactId>
<groupId>com.xx.xx</groupId>
<version>1.0.1</version>
</parent>

使用SpringBoot

1
2
3
4
5
6
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
------ 本文结束------

本文标题:Maven自定义Parent并集成SpringBoot

文章作者:Perkins

发布时间:2019年10月12日

原始链接:https://perkins4j2.github.io/posts/53117/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。