こんにちは、マスター ディレクトリのマルチモジュール プロジェクトから jar を組み立てる必要があります。次のような構造を考えてみましょう。
MASTER(pom)
|
+-A3(pom)
| +-A1(jar)
| +-A2(jar)
+-B3(pom)
+-B1(jar)
+-B2(jar)
私が達成したいのは、マスターですべてのjarパッケージモジュールを組み立てることです。
jars/
+- A1.jar
+- A2.jar
+- B1.jar
+- B2.jar
今のところ、次のような pom.xml を作成することにより、サブモジュール (A3 および B3) で適切な解決策のみを達成しました。
<modules>
<module>../A1</module>
<module>../A2</module>
</modules>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
およびアセンブリ記述子:
<moduleSets>
<moduleSet>
<includes>
<include>org.mycompany:A1</include>
<include>org.mycompany:A2</include>
</includes>
<binaries>
<includeDependencies>false</includeDependencies>
<outputDirectory>jars/${artifactId}</outputDirectory>
<unpack>false</unpack>
</binaries>
</moduleSet>
</moduleSets>
私がする時
mvn clean package assembly:assembly
サブモジュール(A3またはB3)では、個別に独自のサブモジュールをうまく組み立てているようです。
MASTERでアセンブリ記述子を指定する方法がわかりません。A3 および B3 記述子に類似したものは、これを処理しません ([エラー] 少なくとも 1 つのファイルを指定する必要があります)。includeSubModules などの追加のタグをいくつか試しましたが、まだ何もありません。