如何在 Play with Intellij 中创建子项目?
How to create subprojects inside Play with Intellij?
目前我有以下 Play 项目结构:
- PlayApp
- 模块
- 普通
- sub_project_two
PlayApp被标记为一个模块,依赖common。
modules 只是一个目录。
common是一个子项目(也是一个play app)。
sub_project_two是子工程(也是play app),依赖common.
不幸的是,我不能直接右键单击 "modules" 并创建新模块(播放应用程序)并继续。目前,我实际上必须右键单击 PlayApp 并创建新模块,然后将其移动到 "modules",它是 运行 到 Intellij 中的依赖问题并且无法在 [= 中导入 类 40=].
在 Intellij 中创建子项目的正确方法是什么?
在 Intellij 中创建子项目没有任何特殊的方法。子项目在 sbt
构建文件中定义。只要你有 Scala
插件,Intellij 就会发现这些项目并配置它们。我会在您的构建文件中想象以下项目结构:
lazy val PlayApp = Project("playApp", file(".")).aggregate(common, subProjectTwo)
lazy val common = Project("common", file("modules/common"))
lazy val subProjectTwo = Project("subProjectTwo", file("modules/sub_project_two"))
更多详情请访问:http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Multi-Project.html
目前我有以下 Play 项目结构:
- PlayApp
- 模块
- 普通
- sub_project_two
- 模块
PlayApp被标记为一个模块,依赖common。
modules 只是一个目录。
common是一个子项目(也是一个play app)。
sub_project_two是子工程(也是play app),依赖common.
不幸的是,我不能直接右键单击 "modules" 并创建新模块(播放应用程序)并继续。目前,我实际上必须右键单击 PlayApp 并创建新模块,然后将其移动到 "modules",它是 运行 到 Intellij 中的依赖问题并且无法在 [= 中导入 类 40=].
在 Intellij 中创建子项目的正确方法是什么?
在 Intellij 中创建子项目没有任何特殊的方法。子项目在 sbt
构建文件中定义。只要你有 Scala
插件,Intellij 就会发现这些项目并配置它们。我会在您的构建文件中想象以下项目结构:
lazy val PlayApp = Project("playApp", file(".")).aggregate(common, subProjectTwo)
lazy val common = Project("common", file("modules/common"))
lazy val subProjectTwo = Project("subProjectTwo", file("modules/sub_project_two"))
更多详情请访问:http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Multi-Project.html