I have a project of the following form
- pom.xml - projectA - pom.xml - src/main/ - java - startupScript - projectB - pom.xml - src/main/ - java - startupScript - projectAssembly - pom.xml
I want projectAssembly create a tar.gz that contains two folders for ProjectA and one for projectB, in each folder there would be project dependencies and a startupScript library.
The βnaiveβ way to do this is to add the assembly.xml file to each project, which looks something like this:
<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>
Then in projectAssembly , it depends on the <type>tar.gz</type> both projectA and projectB , and add an assembly file that looks something like
<assembly> <dependencySets> <dependencySet> <outputDirectory>/</outputDirectory> <unpack>true</unpack> </dependencySet> </dependencySets> </assembly>
This works, but I donβt need intermediate tar.gz projects A and B , and it takes a lot of time to create them, especially if they have many dependencies.
How can I tell maven to directly collect only tar.gz projectAssembly without wasting time when packing and unpacking intermediate archives?
mikebloch
source share