Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala Play 2.3 InteliJ 14 *community edition - is it possible to run project without cmd line activator command

From http://blog.jetbrains.com/scala/2012/12/28/a-new-way-to-compile/ I understand that Intellij is using sbt to build - so thats 1x build

At the moment I run a separate command line task to run my project -

./activator -jvm-debug 5000 -Dhttp.port=9000

So each code change gets compiled twice (once by InteliJ; once by activator)

Is there a way to use the InteliJ build artifacts when I run, so the code is only compiled once?

Is using the Terminal window in InteliJ any different from a normal terminal window?

The versions I'm at are:

Java 7 Play framework 2.3.4 SBT 0.13.1 InteliJ 14 (community edition)

Thanks Brent

like image 299
brent Avatar asked Oct 31 '22 11:10

brent


1 Answers

Yes it's definitelly possible.

Install Play 2.x plugin (with dependencies) and add the run configuration dedicated for Play 2 (note in Intellij 14 Play2 support is combined within the Scala plugin)

Menu > Run > Edit configurations... > Add new configuration (plus icon in the corner) > Play 2 App

After saving you will be able to run your app (also in debug mode) within IntelliJ - i.e. via

Menu > Run > Debug 'Your Project'

btw, you can remove Make (before launch) from there, SBT should handle builds properly without Idea's support

See sample shot

enter image description here

like image 115
biesior Avatar answered Nov 15 '22 06:11

biesior