project folder in sbt

走远了吗. 提交于 2021-01-29 06:10:59

问题


I understand that in an sbt project, sbt generates a folder called project containing build.properties and plugins.sbt. Now if I have one project that has multi subprojects, should I have only one folder called project in the root project or different folders named project foreach subproject?


回答1:


You should have only one project folder. You can read about it at Multi-project builds in sbt documentation.

For example, to the following sbt:

name := "new_proj"
version := "0.1"
scalaVersion := "2.13.4"

lazy val root = (project in file("."))
  .aggregate(util, core)

lazy val util = (project in file("util"))

lazy val core = (project in file("core"))

You should have the structure:

new_proj
  |- build.sbt
  |- project
    |- build.properties
  |- core
    |- src
      |- main
        |- scala
  |- util
    |- src
      |- main
        |- scala


来源:https://stackoverflow.com/questions/65567049/project-folder-in-sbt

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