8

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?

4

1 回答 1

6

您可以组装一个通用依赖 jar,其中包含所有微服务所需的所有依赖项,您只需构建一次。然后,您可以为每个微服务组装 jar,而无需任何依赖项。

请参阅“拆分您的项目和 deps JAR ”。

于 2015-02-24T02:43:29.877 回答