简体   繁体   中英

How to add one SBT project as a dependency of another?

I have the following project setup:

Base/
  build.sbt
  src/

Main/
  build.sbt
  src/

Where Base and Main are two projects. I would like Main to have the classes of Base on the classpath of Main . If possible, I would like to keep the builds separate. How can I do this?

Thanks!

You can try Multi-Project build, maybe it will be best in you case: http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Multi-Project.html

However if this two projects are completely separate sbt supports source dependencies, it definitely works with github and I think should work with file dependencies as well

lazy val Main = Project("Main", file("."), settings = ...) dependsOn(baseDep)

lazy val baseDep = uri("file:///path/to/base/project")

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