私は次の形式のプロジェクトを持っています
- pom.xml
- projectA
- pom.xml
- src/main/
- java
- startupScript
- projectB
- pom.xml
- src/main/
- java
- startupScript
- projectAssembly
- pom.xml
projectAssembly
projectA 用と projectB 用の 2 つのフォルダーを含む tar.gz を作成したいと思います。各フォルダーには、プロジェクトの依存関係とstartupScript
ライブラリがあります。
これを行う「素朴な」方法は、assembly.xml
各プロジェクトにファイルを追加することです。ファイルはおおよそ次のようになります。
<assembly>
<formats>
<format>tar.gz</format>
</formats>
<baseDirectory>/${project.artifactId}</baseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/src/main/startupScripts</directory>
<outputDirectory>/startupScripts</outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
次に、 で、との両方projectAssembly
に依存し、大まかに次のようなアセンブリ ファイルを追加します。<type>tar.gz</type>
projectA
projectB
<assembly>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<unpack>true</unpack>
</dependencySet>
</dependencySets>
</assembly>
tar.gz
これは機能しますが、プロジェクトA
との中間は必要ありませんB
。特に依存関係が多い場合、それらの作成には時間がかかります。
projectAssembly
中間アーカイブのパックとアンパックに時間を無駄にすることなく、 tar.gz のみを直接アセンブリするように maven に指示するにはどうすればよいですか?