父
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bbw.maven</groupId>
<artifactId>Maven</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<!--配置聚合,可以把配置的所有maven都一键安装-->
<modules>
<module>../testmaven</module>
</modules>
<!--配置依赖管理-->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${com.rod.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<com.rod.version>4.12</com.rod.version>
</properties>
</project>
子
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>testmaven</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>com.bbw.maven</groupId>
<artifactId>Maven</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../Maven/pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project>