Can I make maven-assembly-plugin faster?

I have a multi-module maven project. The ultimate goal covers all the libraries, etc. that we create in tarball and RPM for distribution. This target uses the maven-assembly-plugin module, and it takes forever - usually from a quarter to half of our total build time.

I think we are already telling Maven to start multithreading (although I'm not sure and don't know how to check). Is there any other optimization I can do to make unpacking / repacking faster? Is it just a matter of using a stiffer machine? Our project does not seem so large (the final result is ~ 70-80 MB), but for this phase it takes more than a minute.

+8
source share
3 answers

Try increasing the amount of memory by specifying MAVEN_OPTS = -Xmx [some big value]. I managed to speed it up significantly, but it is still slower than tar. If I have time, I will get sources and profile.

+2
source

I saw how this happened when the maven reactor is huge, for a multi-module multi-level project with a huge hierarchy of dependencies. If this is your case, you might consider splitting the maven project into smaller ones, or suggest / ask for an improvement for the maven collector.

+2
source

Update the Maven Assembly plugin to the latest version. Newer versions are much faster than old ones.

0
source

Source: https://habr.com/ru/post/886340/


All Articles