Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make maven-assembly-plugin go faster?

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.

like image 805
Coderer Avatar asked Apr 20 '11 21:04

Coderer


People also ask

What is goal single in Maven?

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).

What is assembly descriptor in Maven?

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.

What is the use of Maven Assembly plugin?

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.


1 Answers

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.

like image 178
vlad Avatar answered Sep 18 '22 15:09

vlad