How to set system properties for runMain on command line?

前端 未结 3 964

How can I set a system property for runMain upon executing it from command line on Windows?

I\'d like to be able to run the following command:



        
3条回答
  •  执笔经年
    2020-12-08 01:15

    This works:

    sbt '; set javaOptions += "-Dconfig.resource=../application.conf" ; runMain akka.Main com.my.main.Actor'
    

    If this isn't a "friendly" enough syntax, wrap it in a little shell script.

    (Note this assumes you have fork set to true for running. If you don't, see akauppi's comment.)

提交回复
热议问题