我遇到一个MergeStrategy问题。我该如何解决?为什么所有这些波浪线都在那里?
错误消息为Type mismatch, expected: String => MergeStrategy, actual: String => Any
我是scala的新手,所以我不知道该语法的含义。我尝试过从整个stackoverflow复制不同的合并策略,但没有一个可以工作。
我有scala版本2.12.7和sbt版本1.2.6。
我的build.sbt看起来像这样:
lazy val root = (project in file(".")).
settings(
name := "bigdata-mx-2",
version := "0.1",
scalaVersion := "2.12.7",
mainClass in Compile := Some("Main")
)
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-core" % "1.2.1",
"org.apache.parquet" % "parquet-hadoop" % "1.10.0",
"junit" % "junit" % "4.12" % Test,
"org.scalatest" %% "scalatest" % "3.2.0-SNAP10" % Test,
"org.scalacheck" %% "scalacheck" % "1.14.0" % Test,
"org.scala-lang" % "scala-library" % "2.12.7"
)
// Where do I put this thing:
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case x => MergeStrategy.first
}
也许我没有把它放到正确的地方,它会去哪里?