Coderer
Coderer

Reputation: 27284

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.

Upvotes: 8

Views: 3447

Answers (3)

helpermethod
helpermethod

Reputation: 62185

Upgrade to the latest version of the Maven Assembly plugin. Newer versions are much faster than older ones.

Upvotes: 1

kari
kari

Reputation: 21

I've seen this happen when the maven reactor is huge, for a multi-module, multilevel project with enormous dependency hierarchy. If this is the your case, you might consider splitting your maven project to smaller ones, or suggest/ask for improvement for the maven assembly-plugin.

Upvotes: 2

vlad
vlad

Reputation: 36

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.

Upvotes: 2

Related Questions