My build.sbt looks like this:
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-aws" % sparkVersion % Provided,
"org.apache.spark" %% "spark-core" % sparkVersion % Provided,
"org.apache.spark" %% "spark-sql" % sparkVersion % Provided,
"org.scala-lang" % "scala-library" % scalaVersion.value % Provided
)
While running my application from Intellij, I get NoClassDefFoundError
exceptions because it cannot find spark libraries. So when using Intellij, I need:
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-aws" % sparkVersion,
"org.apache.spark" %% "spark-core" % sparkVersion,
"org.apache.spark" %% "spark-sql" % sparkVersion,
"org.scala-lang" % "scala-library" % scalaVersion.value % Provided
)
But that causes the final flat jar to be very big.
How to have different list of Provided dependencies depending whether using Intellij or not?