我想打包多个docker图像,每个都有自己的mainClass,以确保应用程序在启动时运行。
lazy val `core` = project.in(file("core"))
.enablePlugins(JavaServerAppPackaging, DockerPlugin)
.settings{
mainClass in Compile := Some("path/to/Core") // Doesn't work
}
lazy val `benchmark` = project.in(file("benchmark"))
.enablePlugins(JavaServerAppPackaging, DockerPlugin)
.settings{
mainClass in Compile := Some("path/to/Benchmark") // Doesn't work
}这不起作用,因为在stage步骤中找不到mainClasses。
当我将mainClass定义为全局参数时,它可以工作,但我不能以这种方式构建两个自动运行的Docker镜像。
谢谢你的帮忙
发布于 2018-10-09 17:50:39
我没有使用sbt-native-packager的经验,但是mainClass是类路径而不是文件路径,所以它必须定义为:
mainClass in (Compile, packageBin) := Some("com.bar.baz.Foo")https://stackoverflow.com/questions/52717910
复制相似问题