Make shareable code across several Spark SBT proje

2020-03-06 07:17发布

问题:

I have some code that I want to use in different Spark projects. I'm using sbt to create the .jar file.

I saw this idea

Put the shared code into a another project that builds its own JAR file, and use it in both projects.

But that post is old and also exclusively for Java... I'm wondering if there is a better way for my scenario.

回答1:

I've solved this adding in the build.sbt file the followings:

lazy val core = RootProject(file("../coreProject"))

val main = Project(id = "application", base = file(".")).dependsOn(core)