Deploying an assembly jar file with sbt
The assembly-sbt plugin for sbt 0.7, the (not so) simple build tool for scala, creates a nifty fat jar containing everything to run an application anywhere. You may want an additional task to automatically copy it to a server. Here’s how (Linux only, sorry).
The following code copies the assembly jar to a linux computer using ssh. So you need an ssh account there, and you will also need access via a private key. Read this tutorial on how to accomplish this. The key should be password-less, since it will not be possible to enter a password.
Add this to your Project class in project/build/Project.scala. I assume the assembly-sbt plugin is enabled.
Change the properties to match you settings.
What the code is to take the assembly created by assembly-sbt and copies it to the server using scp. It then will create a symbolic link to the copied file, which therefore always points to the most recent version. After that it automatically increments the application’s version.
Run it using