我有一个具有这种结构的多模块SBT项目:
➜ Stample git:(split-in-sbt-modules) ✗ tree -L 1
.
├── project
├── stample-core
├── stample-search
├── stample-web
└── target
构建定义非常简单,如下所示:
lazy val stampleWebProject = play.Project("stample-web", appVersion, appDependencies,path = file("stample-web"))
.dependsOn(stampleCoreProject,stampleSearchProject)
.aggregate(stampleCoreProject,stampleSearchProject)
lazy val stampleCoreProject = Project(id = "stample-core",base = file("stample-core"))
lazy val stampleSearchProject = Project(id = "stample-search",base = file("stample-search"))
我想知道为什么当我使用sbt-idea插件生成IDEA项目文件时,构建定义/project
不会作为模块导入。
它似乎应该是,并且我很确定我已经看到它在我自己的项目上工作但是无法使其再次工作:(顺便说一下,对于新创建的Play2项目,当我们使用插件生成IDEA文件,该项目也作为IDEA模块导入,具有相应的类路径。
此issue似乎表示这是预期的默认行为。
我使用v 1.5.1但尝试使用旧版本,但它也不起作用。
当我运行gen-idea
命令时,我得到:
[info] Excluding folder .ideacalaz-core_2.10;7.0.0 ...
[info] Excluding folder .idea_modules
[info] Excluding folder target
[info] Excluding folder target
[info] Created /home/sebastien/Bureau/Stample/.idea/IdeaProject.iml
[info] Created /home/sebastien/Bureau/Stample/.idea
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-core/.idea
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-core/.idea_modules
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-core/target
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-core/target
[info] Created /home/sebastien/Bureau/Stample/.idea_modules/stample-core.iml
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-search/.idea
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-search/.idea_modules
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-search/target
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-search/target
[info] Created /home/sebastien/Bureau/Stample/.idea_modules/stample-search.iml
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/.idea
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/.idea_modules
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/cache
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/cache
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/classes
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/classes
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/classes_managed
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/classes_managed
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/native_libraries
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/native_libraries
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/resolution-cache
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/resolution-cache
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/resource_managed
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/resource_managed
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.9.2
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.9.2
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/streams
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/streams
[info] Created /home/sebastien/Bureau/Stample/.idea_modules/stample-web.iml
有人可以解释我为什么没有创建项目模块吗?
答案 0 :(得分:0)
所以最后,如果父文件夹不包含在SBT项目中,那么插件似乎不会生成构建定义模块。
添加此行似乎可以解决我的所有问题:
lazy val stampleRootProject = Project(id = "stample",base = file("."))