Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created May 3, 2014 17:01
Show Gist options
  • Select an option

  • Save pedrofurla/752108dc505c52fd2657 to your computer and use it in GitHub Desktop.

Select an option

Save pedrofurla/752108dc505c52fd2657 to your computer and use it in GitHub Desktop.
Start and stop H2 DB server from SBT
val startH2Task = TaskKey[Unit]("start-h2", "Starts H2 DB")
val stopH2Task = TaskKey[Unit]("stop-h2", "Stops H2 DB")
val h2tasks:Seq[Setting[_]] = Seq(startH2Task := {
org.h2.tools.Server.createTcpServer().start();
org.h2.tools.Server.createWebServer().start // this starts the "web tool"
}, stopH2Task :={
org.h2.tools.Server.shutdownTcpServer("tcp://localhost:9092","",true,true);
} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment