Maven
将原始模块按照功能拆分成若干个子模块,方便模块间的相互调用,接口共享
maven可分模块开发,只需要将
将pom文件导入即可
如果有多重依赖,以最后配置的依赖为准
排除依赖(不需要)
可选依赖(不透明)
聚合
继承主要目的是帮助我们进行统一的版本管理,在父工程中定义的dependency
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
在子工程中定义的
<parent>
<groupId>org.example</groupId>
<artifactId>maven_parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../maven_parent/pom.xml</relativePath>
</parent>
即可引入父工程中的依赖
如果在父工程中定义
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.24</version>
</dependency>
</dependencies>
</dependencyManagement>
那么在子工程中只需要
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
引入id,不需要引入版本,因为版本已经交给parent统一管理
属性
私服