How to do a sbt-(local)multi-project without the same project-root?

Related searches

I want to work on multiple sbt-projects at the same time in intellij. The projects are "one way dependent", meaning that one is the (reusable) core and the other is an actual application built upon that core. Both are currently in development.

I want the core to reside in another base/root-directory than the application, so:

- /core
-- build.sbt

- /application
-- build.sbt

I want to be able to

  1. modify both projects in the same IntelliJ-window
  2. leave both projects in their respective folder (no wrapper-folder around them!). Core will be used in other applications as well, applications that are no siblings to the current "application", so I do not want them to reside under the same root-folder!

What I've tried and which problems I've found so far:

setups like

lazy val core = project.in(file("../core"))
lazy val application = project.in(file(".")).dependsOn(core)

are not working, because an sbt asserts that the directory of each project in a multi-project-setup are contained in the same build root:

sbt java.lang.AssertionError: assertion failed: Directory /core is not contained in build root /application

setups like

lazy val core = RootProject(file("../core"))
lazy val application = project.in(file(".")).dependsOn(core)

are not a solution because:

  1. I can not have both projects in one IntelliJ-window then
  2. Strangely the classes of core are not found in application, although the imports worked right away

Now I am a sbt-newbie and I guess (and hope) that there must be a solution for this problem. I can't be the only one wanting to separate my projects without a wrapper-layer and still be able to modify them in the IDE of my choice.

edit:

@OlegRudenko´s solution is semi-working for me. As core has some dependencies as well, I cannot compile or work with it in application.

core pulls in some dependencies like e.g. a Logger and when I'm in application and try to use a component of core the compiler screams at me, because it can't find the dependencies in core (e.g. the logger).

Also, core pulls in e.g. lwjgl and I want to use some components of it in application, no chance, because it can't find the packages for that dependency of core.

For now what I do is a hacky non-solution. I just develop both core and application in the same intellij-project and keep the git-repo private.

This is not a solution at all, as I want to open source core while application is closed source for now and I still want to work on both at the same time, refine the core etc.


scala - How to reuse SBT module project definitions, I have one idea: Perhaps I can create a module for e.g. the Dao project, with a trait that import sbt._ object RootProject extends Build { lazy val projects = Seq(​root, core, How to do a sbt-(local)multi-project without the same project-root? Any .sbt files in foo, say foo/build.sbt, will be merged with the build definition for the entire build, but scoped to the hello-foo project. If your whole project is in hello, try defining a different version (version := "0.6") in hello/build.sbt, hello/foo/build.sbt, and hello/bar/build.sbt. Now show version at the sbt interactive prompt. You


Professional Scala, In this case, you have a root project and two subprojects (one for JVM and one for Scala.js). If you examine the build.sbt, you can see how this is set up. name := "​Foo root project" lazy val root = project.in(file(". -sbt.org/0.13/docs/ Multi-Project.​html). [info] published foo_2.11 to /Users/matthewdedetrich/.ivy2/local/foo/  sbt-multi-project-example. The goal of this example is to provide a multi-project build using sbt providing:. A single build.sbt file which allows for centralized configuration, dependency and build management


You could use ProjectRef:

lazy val my_application = (project in file ("."))
    .aggregate(my_core)
    .dependsOn(my_core)

lazy val my_core = ProjectRef(file("../my_core"), "my_core")

Then, regarding the directory structure, my_application and my_core are siblings.

sbt Reference Manual, sbt are part of the same build definition. Style choices: Each subproject's settings can go into *.sbt files in the base directory of that project, while the root  I need help with SBT, local dependencies, multiple-projects without the same root-dir and building a working .jar First of, let me say that I'm using sbt successfully in two (other, unrelated) projects already.


sbt auto-plugins - disable them but for one sub project, How to do a sbt-(local)multi-project without the same project-root? I want to work on multiple sbt-projects at the same time in intellij. The projects are "one way  In SBT 0.12 this is very easy to set up. The first thing you need to do is convert the build.sbt to Build.scala if you are using a .sbt build definition for your build configuration. Since the syntax is very similar, this probably won’t be a problem. More information about this subject is in the getting started guide of SBT.


How to set the default project for SBT - scala - html, How to do a sbt-(local)multi-project without the same project-root? I want to work on multiple sbt-projects at the same time in intellij. The projects are "one way  Sorona. Apparently, this user prefers to keep an air of mystery about them. 8 How to do a sbt-(local)multi-project without the same project-root? View more


Defining Multi-project Builds with sbt - Pol Bassiner, Let's setup a simple multi-project build using sbt , assuming we're Since the global project is in the project root folder, we need to There's no need to do so with the other sub-projects since they are "Local Maven Repository" at "file://" + Path. We'll follow the same strategy with the dependencies. Running sbt run on project root directory (Play Framework 2.6.x project) and consuming an API that triggers SparkLauncher to run a job. problem. I am working on a project where (PROD) I can run the Play Framework services using. sbt dist And then running the executable script from target/universal/*. (DEV) But not the development server using