これは、マルチモジュール ビルドの典型的なシナリオのようです。
.
├── mod-a
│ └── pom.xml
├── mod-b
│ └── pom.xml
└── pom.xml (parent)
親には、次のように見えるモジュール (2 つ) のリストが含まれています。
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.soebes.smpp</groupId>
<artifactId>smpp</artifactId>
<version>0.7.1</version>
</parent>
<groupId>com.soebes.training.first</groupId>
<artifactId>project-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Project : Parent</name>
<scm>
Define the SCM information here...
</scm>
<modules>
<module>mod-a</module>
<module>mod-b</module>
</modules>
</project>
すべての子は次のようになります。
<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>
<parent>
<groupId>com.soebes.training.first</groupId>
<artifactId>project-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<name>Project : Mod-A</name>
<artifactId>mod-a</artifactId>
</project>
そして、module-b は次のようになります。
<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>
<parent>
<groupId>com.soebes.training.first</groupId>
<artifactId>project-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<name>Project : Mod-B</name>
<artifactId>mod-b</artifactId>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mod-a</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
これで、親モジュールからビルドでき、これらすべてを中央にデプロイする必要があり、これを個別に行う必要はありません。親から一度に行うことができます...