SBT compilation for the gaming environment 2.x disabled by default

I created a new Play Framework project using the activator new my-project-name , and then I selected the play-java template and the project was created without errors.

Then I import the project into my IDE, IntelliJ, as an SBT project. When a project is imported, a pop-up message is displayed: SBT compilation for play framework 2.x disabled by default .

In the IntelliJ project panel, it does not display all files (mainly files with code). Only a few of them.

enter image description here

The build.sbt file looks like a complete compilation error (almost all lines are underlined in red).

Here is the build.sbt file

 name := """my-project-name""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.11.6" libraryDependencies ++= Seq( javaJdbc, cache, javaWs ) // Play provides two styles of routers, one expects its actions to be injected, the // other, legacy style, accesses its actions statically. routesGenerator := InjectedRoutesGenerator fork in run := true 

I can compile and run code with activator ui without errors. So why is IntelliJ not fully importing the project, and it shows me the message SBT compilation for play framework 2.x disabled by default ?

I googled around and could not find any hint related to this, so I lost a little here.

EDIT: -------------------------------------

I closed the project on IntelliJ and deleted the project folder. Closed IntelliJ and using activator , I created the same project again. Using activator ui , I compiled the project. Then I activated IntelliJ, and I was asked to either open the project, create a new one or import the project.

The selected project import and the normal β€œimport of project steps”, and IntelliJ imported the project without any problems. But , if I try to import a project, and with an open project in IntelliJ, I get the same problem that makes me ask this question. Maybe this is a bug in IntelliJ?

EDIT 2 ------------------------------------------

The solution to these two problems ("SBT build for the 2.x playback environment is disabled by default" and files not displayed on IntelliJ) can be fixed with the answers user3384225 and DarkShadow .

+48
intellij-idea playframework sbt
Oct 18 '15 at 21:27
source share
8 answers

Preferences> Languages ​​and frames> Play2

In the "Compiler" section, enable "Use the Play 2 compiler for this project"

enter image description here

+58
Oct 20 '15 at 17:37
source share

A similar response to user3384225 was sent here:

They say:

  • Settings β†’ Langauges and Frameworks β†’ Play2 β†’ Compiler β†’ Compiler User Play 2 for this project
+4
Oct. 20 '15 at 9:31
source share

I am also a newbie and ran into the same problem until yesterday. Perhaps you are trying to open a project through File-> open.

Try the following: -

File-> New-> Project from existing source-> select build.sbt from the project created using the activator-> Import project from external model, and select SBT from options-> OK.

It will take some time to import the files and create the settings necessary for the intellij idea project. I am using intellij idea 14.1.5. It worked for me, hope it will be for you too.

+2
Oct 22 '15 at 13:55
source share

For current projects, you can fix this using File->Invalidate Caches/Restart..

+2
Oct 27 '15 at 19:02
source share

Stumbled upon the same problem today. It is solved by cleaning the ~/.IntelliJIdea14 . Unfortunately, everything I tried did not help.

0
Oct 21 '15 at 12:08
source share

Just use: File-> New-> Project from existing source-> select build.sbt from the project created with the activator-> ok. and it was done.

0
Jun 21 '16 at 12:40
source share

Most likely, you solved the problem, but just to help others. What you need to do is check the option "Use the Play 2 compiler for this project" in the "Settings" β†’ "Languages ​​and Frames" β†’ "Play2" β†’ "Compiler"

0
Oct 13 '16 at 7:33
source share

I myself came across this problem when setting up the game environment for IntelliJ IDEA IDE (version: 2017.3). I overcame this problem by following these steps.

Switch to:

 File --> Settings --> Languages and Frameworks --> Play2 --> Compiler tab 

and inside the compiler tab:

put a tick in Use Play2 Compiler for this project

enter image description here

Hope this helped.

0
Dec 08 '17 at 1:31 on
source share



All Articles