I have an sbt project with a very basic class. It works perfectly but when I'm trying to run it in Docker using simple docker run imagename command it throws
Error: Could not find or load main class java -jar scala_test_trash_2.11-1.0-one-jar.jar
Main class:
package com
object Main extends App {
println("Testing hello world.")
}
build.sbt:
import com.github.retronym.SbtOneJar
import com.github.retronym.SbtOneJar.oneJar
import sbt.Keys.mainClass
name := "scala_test_trash"
version := "0.1"
scalaVersion := "2.11.12"
lazy val rootProject = (project in file("."))
.settings(
Seq(exportJars := true),
SbtOneJar.oneJarSettings,
libraryDependencies ++= Seq(
"com.google.cloud" % "google-cloud-pubsub" % "0.34.0-beta",
"com.sendgrid" % "sendgrid-java" % "2.2.2"
),
mainClass in oneJar := Some("com.Main")
)
I have an sbt project with a very basic class. It works perfectly but when I'm trying to run it in Docker using simple
docker run imagename
command it throwsMain class:
build.sbt:
plugins.sbt:
addSbtPlugin("org.scala-sbt.plugins" % "sbt-onejar" % "0.8")
Dockerfile: