project/Dependencies.scala not accessible from plugins.sbt

最后都变了- 提交于 2019-12-22 10:55:12

问题


I'm unable to reference the object Dependencies from within plugins.sbt on compile getting the error error: not found: value Dependencies

/project/plugins.sbt
/project/Dependencies.sbt

Depencies.scala is just a collection of objects

object Dependencies { 
  object Play {
    ...
    val sbtPlugin = "..." 
...

Similarly I use it in ./build.sbt to add libraryDependencies without problems:

lazy val root = (project in file("."))
  .enablePlugins(PlayScala)
  .settings(libraryDependencies += Seq(
    Dependencies.Play.dependencies, ...

Thanks for any ideas, I'm curious more than anything why build.sbt can access project folder resources


回答1:


If you want a dependencies files to be accessible from project/plugins.sbt then you need to put it into project/project/Dependencies.scala.

(I'm assuming your file is called Dependencies.scala, not Dependencies.sbt or Depencies.scala as shown in your question.)

In general somedir/*.sbt files can access .scala files in somedir/project/*.scala.



来源:https://stackoverflow.com/questions/47143350/project-dependencies-scala-not-accessible-from-plugins-sbt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!