问题
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