Im trying to use a single Intellij IDEA window with multi projects (that are not related) imported.
The problem that I'm facing is when I'm executing a sbt task
, the task is not loaded in the right project directory.
This is what I did (all in the Intellij Idea window):
- Opened a
root
empty sbt project. - In the sbt toolbar, I clicked the
+
and added 2 projectsjob-service
anduser-service
(each was its ownbuild.sbt
file) - Pressed
Reimport All sbt projects
just for fun - Executed
compile
(from the sbt toolbar) for theuser-service
The sbt shell opened, and started compiling the empty root project:
[info] Set current project to root (in build file:/Users/dima/git/root/)
[IJ]sbt:root> compile
what I've expected is
[info] Set current project to user-service (in build file:/Users/dima/git/user-service/)
And of course, the same for the second project job-service
Versions:
Idea version: Version: 2019.2 Build: 192.5728.98
SBT version = 0.13.18
I know the way to use a single build.sbt
file with multi projects. But those projects are not related. each project has its own build.sbt
file.
I just want to use a single Idea window with multiple projects. and that the sbt toolbar could execute the tasks to the right project
Thanks!
EDIT:
This is the process to recreate what I'm facing:
- open project named root2
- Import another sbt project called
learner
- Compile the learner project from the sbt toolbar!
- The Problem: sbt shell sets current project to root2
the same for publishLocal
task. it sets the current project to root2 and publishes a root2 artifact.
what should have been, is that the sbt would set the current project to learner