Folders/packages in sbt ./project folder

≡放荡痞女 提交于 2019-12-24 11:01:41

问题


Looks strange to me, maybe i'm doing something wrong, but when i'm trying to launch sbt it can't find/compile files from folders/packages inside ./project folder, like:

root/
  project/
    deploy/DeployModule.scala
           DeployConfig.scala
    Build.scala

SBT can't resolve by build.deploy.DeployModule._ import, but if i move files from deploy folder into project folder it works. So it looks like SBT can't resolve files in nested folders inside project folder?


回答1:


Sbt's meta build uses the default sbt build (with a few minor extras). As such, root-level .scala/.java files are picked up, but if you want things in sub-directories, you'll need to place them like so:

root/
  project/
     src/main/scala/deploy/
       DeployModule.scala
       DeployConfig.scala
    Build.scala


来源:https://stackoverflow.com/questions/23954464/folders-packages-in-sbt-project-folder

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