简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM