简体   繁体   中英

Multi module sbt within Intellij Idea

I'm trying to create a new multi module sbt project in Intellij Idea. So far, I have created an sbt project, but I'm struggling to get the multi module effect implemented.

import sbt._

object MyBuild extends Build {

  lazy val modA     = Project("modA", file("modA"))
                          .settings(
                            libraryDependencies ++= modADependencies
                          )

  lazy val modB = Project("modB", file("modB"))
                          .settings(
                            libraryDependencies ++= modBDependencies
                          )

  lazy val root = Project("root", file(".")).aggregate(modA, modB)
}

I have the following structure in my Intellij sbt project:

 - TopLevelProject
  - modA
     - src
         - main
             - scala
  -modB
     - src
         - main
             - scala
  -project
     - Build.scala
     - Dependencies.scala

When I run sbt, and then run projects , I would like to see a list of the separate projects (ie modA, modB, and root). But I only get the top level project.

sbt.version = 0.13.8 if that matters :).

I've tried to reproduce your issue. Unfortunately, I have to conclude that your MyBuild.scala file is correct. When I run it with sbt 0.13.5 I get the following output:

> projects
[info] In file:Path/To/Application/
[info]     modA
[info]     modB
[info]   * root

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM