- Here is the build.sbt which I used to create the basel-face-pipeline jar file:
name := "basel-face-pipeline"
version := "0.1"
scalaVersion := "2.11.8"
// Define compiler options
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")
// Define resolvers for external dependencies
resolvers += Resolver.jcenterRepo
resolvers += Resolver.bintrayRepo("unibas-gravis", "maven")
// Define library dependencies
libraryDependencies += "ch.unibas.cs.gravis" %% "scalismo-faces" % "0.5.0"
libraryDependencies += "ch.unibas.cs.gravis" %% "scalismo-ui" % "0.11.+"
libraryDependencies += "ch.unibas.cs.gravis" %% "scalismo" % "0.15.0"
libraryDependencies += "com.github.tototoshi" %% "scala-csv" % "1.3.3"
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.5.0"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.7"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test"
libraryDependencies += "org.rogach" %% "scallop" % "2.1.3"
// Exclude slf4j-nop from all dependencies
libraryDependencies ~= { _.map(_.exclude("org.slf4j", "slf4j-nop")) }
// Define the main class for assembly
assembly / mainClass := Some("ch.fitting.experiments.RecognitionMultiPiePose")
mainClass in Compile := Some("ch.fitting.experiments.RecognitionMultiPiePose")
// Define a main class for the "packageConfig" configuration
mainClass := Some("ch.fitting.experiments.RecognitionMultiPiePose")
Compile / packageBin / mainClass := Some("ch.fitting.experiments.MultiPiePose")
// Define merge strategies for assembly
assembly / assemblyMergeStrategy := {
case PathList("META-INF", xs @ _*) =>
(xs map { _.toLowerCase }) match {
case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil) =>
MergeStrategy.discard
case ps @ (x :: xs) if ps.last.endsWith(".sf") || ps.last.endsWith(".dsa") =>
MergeStrategy.discard
case "services" :: xs =>
MergeStrategy.filterDistinctLines
case _ => MergeStrategy.first
}
case _ => MergeStrategy.first
}
And when I run the build.sbt and use the jar then I get the following error:
java -jar basel-face-pipeline.jar
Error: Unable to initialize main class fitting.experiments.RecognitionMultiPiePose
Caused by: java.lang.NoClassDefFoundError: scalismo/utils/Random
I think this should be handled by buid.sbt but it is not.
I am running into an error, I am on Mac OSx
Best regards,