Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Play project from sbt

I am about to publish a Play project to github, but I would like that Scala developers don't need to install play separately if they already have sbt installed.

Would it be possible to compile and run a Play project with sbt if we add the correct dependencies ?

My working build.sbt for Play is here, but it doesn't work with sbt.

import play.Project._

name := "my_project_name"

version := "1.0"

libraryDependencies ++= Seq(
  "com.netflix.rxjava" % "rxjava-scala" % "0.17.4",
  "oauth.signpost" % "signpost-core" % "1.2.1.2",
  "oauth.signpost" % "signpost-commonshttp4" % "1.2.1.2",
  "org.apache.httpcomponents" % "httpclient" % "4.3.3",
  "commons-io" % "commons-io" % "2.3"
)

playScalaSettings

Thanks!

like image 539
ffarquet Avatar asked Jan 11 '23 13:01

ffarquet


1 Answers

You just should add the following line to project/plugins.sbt file:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.3") // or your play version

play new does this by default.

You may check if the project is executable by sbt by executing sbt run from the terminal.

like image 95
ForNeVeR Avatar answered Jan 18 '23 04:01

ForNeVeR