I'm following up on this question, as it helped me get my "common" project recognized, but i'm not able to use it. How to reference external sbt project from another sbt project?
Project structure
/src/services/api/project
- build.sbt contains all dependencies, plus dependsOn(commonlib)
/src/commonlib/project
- build.sbt is very minimal, just basic definitions.
SBT loads everything fine, when i click on the object i'm trying to use it opens in intellij and import commonlib.conversions.SomeConversion is recognized (by Intellij and clickable to my local copy).
api - sbt
lay val project = Project( id = "company", file("."), settings)
.enablePlugins(JettyPlugin)
.dependsOn(commonlib)
lazy val commonlib = RootProject(file("../../commonlib"))
commonlib is also an SBT project with /src/commonlib/src/main/scala/commonlib
in the main project i'm importing
import commonlib.conversions.SomeConversion
...
val converted = SomeConversion.convert(x)
I get a comple error stating: not found: object commonlib
The top of the commonlib.conversions looks like
package commonlib.conversions
Any help is greatly appreciated. I may be headed down the wrong path entirely and could likely solve this with git subrepos, but i'm looking to share this across multiple projects hence the (slightly) made up name. And ultimately understand the import/sbt system better. I don't want this to be a remote jar as i'll be editing as much as the api package.
Thanks!
lazy val coreLib = RootProject(file("../../companylib"))
and made the apiproject.dependsOn(coreLib)
. So far so good, but still working out a few kinks. Thanks for the pointers. I'm too new to publicly upvote your url, i'll be sure to come back. – ekydfejj