Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding How SBT, Scala, SBT-Idea and Play Framework Work Together

I am new and had built some simple Scala applications / tutorials using SBT. I move on to Play framework and generated an empty project using g8 typesafehub/play-scala. I did a few tests to make sure it was properly generated. That checked out good and I added sbt-idea plugin, https://github.com/mpeltonen/sbt-idea, to generate an IntelliJ project. This is where the hell broke loose.

I had to find the right Scala, SBT, Play framework and sbt-idea versions combinations to get it compiled perfectly. Otherwise, the compilation would broke with out right errors or warnings that got me guessing. So far, the best "combination" I had was

Scala 2.9.2 
Play 2.0.1 
SBT 0.11.2 
sbt-idea 1.1.0

with the following warning

 [warn]  [NOT FOUND  ] maven-plugins#maven-cobertura-plugin;1.3!maven-cobertura-plugin.plugin (282ms)
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/maven-plugins/maven-cobertura-plugin/1.3/maven-cobertura-plugin-1.3.plugin
[warn]  [NOT FOUND  ] maven-plugins#maven-findbugs-plugin;1.3.1!maven-findbugs-plugin.plugin (284ms)
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/maven-plugins/maven-findbugs-plugin/1.3.1/maven-findbugs-plugin-1.3.1.plugin
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: maven-plugins#maven-cobertura-plugin;1.3!maven-cobertura-plugin.plugin
[warn]  :: maven-plugins#maven-findbugs-plugin;1.3.1!maven-findbugs-plugin.plugin
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

If I use the latest versions, SBT 0.12 and Play 2.0.3 I would get a complilating error. Any idea or explanation how I can get all these works together nicely? It is a version mess to me right now. Thanks

like image 397
thlim Avatar asked Sep 16 '12 10:09

thlim


People also ask

What is SBT in play framework?

sbt : The sbt settings that describe building your application. /conf : Configuration files for your application. /project : Further build description information. /public : Where static, public assets for your application are stored. /test : Where your application's test code will be stored.

Who uses Playframework?

Who uses Play? 289 companies reportedly use Play in their tech stacks, including LinkedIn, Glovo, and Accenture.

How do I run a play framework?

To run a Play application: Create a new Run Configuration – From the main menu, select Run -> Edit Configurations. Click on the + to add a new configuration. From the list of configurations, choose “sbt Task”


1 Answers

I think that you should start with Play from the original site: http://www.playframework.org/ you'll find there newest stable version for download (currently it's 2.0.3).

It contains proper dependencies and its installation is as easy as unpacking the ZIP and exporting the path as described in: Installing doc.

I can ensure you that this approach is the easiest and most sure way, it works as expected, creates proper IntelliJ projects etc. If I'm not wrong IntelliJ support was fixed after 2.0.1 also other indices had some improvements, so there is no sense to fight with 2.0.1 if it isn't really required.

like image 119
biesior Avatar answered Sep 22 '22 14:09

biesior