I have a maven multi-module project. The final goal wraps up all the libraries, etc., that we build in a tarball and RPM for distribution. This goal uses the maven-assembly-plugin, and it takes forever -- usually a quarter to a half of our total build time.
I think we're already telling Maven to run multithreaded (though I'm not positive, and don't know how to check). Is there any other optimization I can do to make unpacking / repacking go faster? Is it just a matter of using a beefier machine? Our project doesn't seem that big (end result is ~70-80 MB) but it takes well over a minute just for that one phase.
This goal is suitable either for binding to the lifecycle or calling directly from the command line (provided all required files are available before the build starts, or are produced by another goal specified before this one on the command line).
So in order for you to customize the way the Assembly Plugin creates your assemblies, you need to know how to use the Assembly Descriptor. This descriptor specifies the type of assembly archive to create, the contents of the assembly, and the ways in which dependencies or its modules are bundled with an assembly.
The Assembly Plugin for Maven enables developers to combine project output into a single distributable archive that also contains dependencies, modules, site documentation, and other files. Your project can easily build distribution "assemblies" using one of the prefabricated assembly descriptors.
Try increasing memory by specifying MAVEN_OPTS=-Xmx[some large value]. I managed to speed it up significantly, but it is still slower than tar. If I have time I will get the sources and profile it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With