I'm trying to convert a single module project into two modules with a root aggregate. Feels like a normal thing to do.
So, to simplify I have removed the second project that I added, but I do something like:
cd myproject
mkdir core
mv * core
and then add a build.sbt in myproject like
lazy val root = project.in( file(".") ).aggregate(core)
lazy val core = project in file("core")
However, trying to build core I get:
[myproject]/core/build.sbt:22: error: not found: value lessSettings seq(lessSettings:_*)
which is the settings for a plugin added in project/plugins.sbt of the original project now in
[myproject]/core/project/plugins.sbt
How come this is not picked up? Can't I have plugins living only in submodules? cd:ing into core submodule and running sbt it works just fine. Do I have to move my plugins to root/project? Pretty please, it can't be so?
Your plugin.sbt
file is ignored because you cannot have a project
subfolder in a sub-project of a multi-project build.
In a multi-project build,
The .sbt
files of the root project, and all .sbt
files of all sub-projects, are all part of a single build definition. The settings defined in a sub-project are just automatically scoped to that project.
Since there is only one build definition, there is only one project to build that build definition, and that is in the project/
folder of the root project. All project/
folders of sub-projects will be ignored.
In your case, moving your plugin.sbt
to the build root project
folder should make your plugin appear again.
Furthermore, if you only work on the core
project, instead of running sbt
in core, you can run sbt
in the root project and type project core
to "move" (actually, scope everything you do) to the core sub-project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With