问题
I have a MergeStrategy problem. How do I resolve it? Why are all those squiggly lines there?
The error message is Type mismatch, expected: String => MergeStrategy, actual: String => Any
I am new to scala, so, I have no idea what that syntax means. I have tried copying different merge strategies from all over stackoverflow and none and them work.
I have scala version 2.12.7 and sbt version 1.2.6.
My build.sbt looks like this:
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
}
Maybe I'm not putting it into the right place, where does it go?
来源:https://stackoverflow.com/questions/53068110/where-do-you-put-assemblymergestrategy-in-build-sbt