在多个 Spark SBT 项目中创建可共享的代码 [英] Make shareable code across several Spark SBT projects

查看:22
本文介绍了在多个 Spark SBT 项目中创建可共享的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些代码想在不同的 Spark 项目中使用.我正在使用 sbt 创建 .jar 文件.

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

我看到了这个想法

将共享代码放入另一个项目中,该项目构建自己的 JAR文件,并在两个项目中使用它.

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

但是那篇文章已经过时了,而且还专门针对 Java...我想知道是否有更好的方法适合我的场景.

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

推荐答案

我已经解决了这个问题,在 build.sbt 文件中添加以下内容:

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)

这篇关于在多个 Spark SBT 项目中创建可共享的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆