Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify different version of sbt for a subproject in multi-project?

Tags:

scala

sbt

I have a multi-project containing a few subprojects.

The root project's project/build.properties contains

sbt.version=0.13.0

It turned out that one of the subprojects works only with the version 0.12.4 due to a dependency issue.

I put build.properties with that version into its directory but it didn't change the version of sbt for this project.

How do I do that properly? Is it possible at all?

like image 940
Incerteza Avatar asked Dec 29 '13 13:12

Incerteza


1 Answers

Right now, sbt allows deep task-level dependencies between projects in the same build. So, while the projects each have their own directory, they share one classloader for their build which has all the definitions.

This places the limitation that you cannot have builds sharing incompatible versions.

Removing this restriction may be possible in the future, but for now I'd do one of the following:

  1. Just keep using sbt 0.12.4 for your build
  2. Migrate all communication between projects to happen via Ivy. Have 2 builds with a wrapper script which runs them in the correct order.
like image 146
jsuereth Avatar answered Nov 05 '22 04:11

jsuereth