マルチモジュールプロジェクトを作成し、Mavenのアセンブリプラグインを使用してプロジェクトのアーティファクトを圧縮しました。
Proj
+Module A
pom.xml
+Module B
pom.xml
pom.xml
メインモジュールを作成すると、次のものが生成されます
Proj
+Module A
target\A.jar
target\A-source.jar
target\A-javadoc.jar
+Module B
target\B.jar
target\B-source.jar
target\B-javadoc.jar
1)ModuleB pomファイルの下にアセンブリプラグインを追加し、アセンブリ記述子ファイルでModuleSetを使用しています
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>groupA:A:jar</include>
<include>groupA:A:javadoc</include>
<include>groupA:A:source</include>
</includes>
<binaries>
<outputDirectory>moduleA</outputDirectory>
<unpack>false</unpack>
</binaries>
</moduleSet>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>groupB:B:jar</include>
<include>groupB:B:javadoc</include>
<include>groupB:B:source</include>
</includes>
<binaries>
<outputDirectory>moduleB</outputDirectory>
<unpack>false</unpack>
</binaries>
</moduleSet>
</moduleSets>
しかし、zipファイルで取得しているのはA.jarとB.Jarだけです。javadocとソースをzipファイルで取得していません。m2リポジトリからダウンロードしているのでしょうか。ソースとJavadocがmavenリポジトリのアーティファクトに存在しないため、ダウンロードしているのではないかと疑っています。3つすべてのアーティファクトをzipファイルに追加するにはどうすればよいですか?
2)ModuleBのpomではなく親pomにアセンブリプラグインを追加したいのですが、追加すると、「アセンブリが生成される前にパッケージフェーズが実行されていることを確認してください」という例外が発生します。グーグルした後、モジュールとしてアセンブリを追加するための提案はほとんど見つかりませんでした。これを処理する他の方法はありますか?