Use SBT to launch an applicative task/batch?

▼魔方 西西 提交于 2019-12-25 07:39:42

问题


Can SBT be used to launch applicative Scala batches?

I mean, a Scala applicative code that would decrement all the user's balance for exemple.

I can imagine a special SBT project for that with a build dependency on the applicative code, so that some SBT tasks of the project can launch this applicative code.

Would you do such a thing? Why?

What are the alternatives to ease the launch of applicative batches in Scala? With Maven I used to use the appassembler plugin which would generate sh scripts and all the classpath related stuff.


回答1:


A simple way is to use sbt run.

object Main {
   def main(args: Array[String]) {
   // decrement all user balances.
   };
};

Then sbt run from shell, jenkins, etc.

Use command line args to expand the functionality.



来源:https://stackoverflow.com/questions/17954154/use-sbt-to-launch-an-applicative-task-batch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!