0

So I created a bare bone play2 scala application using the command line.

I then was reading how IntelliJ 13 can handle sbt projects better, so I opened it using IntelliJ using the build.sbt file.

I selected 'auto imports', and then literally it just started downloading for like 15+ minutes. And finally it stopped and intellij could properly resolve all the classes etc. correctly and it built correctly.

What was wierd was my /target folder was in the solution, so I removed it.

Did I do something wrong or this is normal?

Also, how do I run the application using IntelliJ that would be similiar to:

play run
loyalflow
  • 14,275
  • 27
  • 107
  • 168

2 Answers2

1

The Best way is using the command play idea which generates all the files needed to import the project seamlessly. The configuration created also tells Idea to resolve dependencies in target/ and project/target folders instead of the IDE own folders (I don't know the exact location of these folders). This way all the Play! files don't need to be resolved twice, like it happened in your case.

Regarding the second part of the question I personally use the idea console to execute Play! or sbt commands.

marcyb5st
  • 252
  • 1
  • 5
  • So what exactly is happening. When sbt downloads the dependencies, where is that stored? And is IDEA doing it again in their own folder? – loyalflow Apr 10 '14 at 15:58
  • Yes I noticed a folder idea created, I think it is ".idea" and it from what I recall there was a folder with all the jars etc. – loyalflow Apr 10 '14 at 16:27
  • I was checking because your question made me think. It could also be related to the fact that Idea sbt plugin looks in target/ and project/target as expected in sbt projects, but the structure of a Play! application differs. I hope someone with more knowledge can clarify this point – marcyb5st Apr 10 '14 at 16:33
1

Just type idea in the play console, this will update your project to IntelliJ structure, after that go to IntelliJ and Import Project, it can take a couple of minutes but not 15 like you say.

Roger
  • 83
  • 1
  • 2
  • 12