score:3

Accepted answer

remeber sbt is recursive.

.sbt define things that are available in the current layer.
.scala files define thins that will be available in the next layer.

adding an sbt plugin in project/bar.sbt is adding that plugin to the meta layer, as such the meta-layer that compiles the sbt you are using to compile your project adds those plugins to the next sbt layer.

so if you add a compiler plugin in project/foo.sbt then you are adding that compiler plugin to the compiler used to compile the project (meta) layer of sbt, but it will not be available in the current layer of sbt. that is the reason why compiler plugins are added in the build.sbt file, so they are added to the compiler used to compile your code.


Related Query

More Query from same tag