sbt 包不添加依赖项
sbt package not adding dependencies
我正在尝试使用 sbt package
构建 jar。
build.sbt
:
name := "Simple Project"
version := "0.1"
scalaVersion := "2.11.8"
val sparkVersion = "2.3.2"
val connectorVersion = "2.3.0"
val cassandraVersion = "3.11"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % sparkVersion % "provided",
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
"org.apache.spark" %% "spark-hive" % sparkVersion % "provided",
"org.scalaj" %% "scalaj-http" % "2.4.2",
"com.datastax.spark" %% "spark-cassandra-connector" % connectorVersion
)
sbt package
成功运行,但未将 spark-cassandra-connector 和 scalaj-http 添加到创建的最终 jar。
我需要添加什么吗?
如果你想让 jar 包含你所有的依赖,你必须使用 sbt assemlbly 插件:
我正在尝试使用 sbt package
构建 jar。
build.sbt
:
name := "Simple Project"
version := "0.1"
scalaVersion := "2.11.8"
val sparkVersion = "2.3.2"
val connectorVersion = "2.3.0"
val cassandraVersion = "3.11"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % sparkVersion % "provided",
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
"org.apache.spark" %% "spark-hive" % sparkVersion % "provided",
"org.scalaj" %% "scalaj-http" % "2.4.2",
"com.datastax.spark" %% "spark-cassandra-connector" % connectorVersion
)
sbt package
成功运行,但未将 spark-cassandra-connector 和 scalaj-http 添加到创建的最终 jar。
我需要添加什么吗?
如果你想让 jar 包含你所有的依赖,你必须使用 sbt assemlbly 插件: