当前位置: 动力学知识库 > 问答 > 编程问答 >

scala - 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 (i.e. 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
分享给朋友:
您可能感兴趣的文章:
随机阅读: