Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speeding up SBT-assembly

We have a project where we are building a large number of Scalatra microservices by packaging them using the sbt-assembly plugin, then creating Docker images using the sbt-docker plugin. The process is slow due to the number of micro-services because the assembly plugin has to process all the transitive dependencies for each service. However I note most of the micro-services have very similar dependencies. Is there any way to speed this up?

One limitation is we are doing this on Jenkins (CI) server so we are calling sbt clean at the start so we are not able to take advantage of any caching?

like image 900
Mark Butler Avatar asked Feb 03 '15 22:02

Mark Butler


1 Answers

You could assemble a common dependency jar that has all the dependencies all your microservices need, which you would only need to build once. Then you could assemble jars for each of the microservices without any of the dependencies.

See "Splitting your project and deps JARs".

like image 137
Daniel McDonald Avatar answered Sep 18 '22 15:09

Daniel McDonald