我希望有一个新的sbt任务runDev
,它相当于首先设置系统属性,然后运行run
:
sbt '; set javaOptions += "-Dlogback.configurationFile=logback-dev.xml" ; run'
我怎样才能在sbt中执行此操作?
答案 0 :(得分:1)
lazy val runDev = taskKey[Unit]("Run with custom java options")
fork in runDev := true
javaOptions in runDev += "-Dlogback.configurationFile=logback-dev.xml"
fullRunTask(runDev, Compile, "mainClass")
答案 1 :(得分:0)
一种方式:
_onTypedAnswer