Play Framework 2.x
IntelliJ IDEA supports integration with Play Framework 2.x.
Note that for the IntelliJ IDEA version 14.0 , the Play 2.x framework is merged with the Scala plugin.
Before you start creating a Play 2 project, make sure that the latest Scala plugin version is downloaded and enabled in IntelliJ IDEA.
Play Framework Support
The Play Framework support includes the following features:
- Code assistance
- Error highlighting
- Code inspections
- Code assistance for
- Creating a Play application
- Importing an existing Play project
- Running and Debugging a Play application
Creating a Play Application
You can create a Play application the same way you create a new project in IntelliJ IDEA.
To create a play application
- On the Welcome Screen, select Create New Project. Alternatively, on the main menu, select File | New Project.
- On the first page of the wizard, in the left-hand pane, select Scala.
If you want to create a Java project with the Play 2.x framework support then in the left-hand pane, select Java.On the right part of the page, select Play 2.x and click Next.
- On the next page of the wizard, enter the project's information and click Finish.
Importing an Existing Play Project
You can import an existing Play project.
To import a Play project
- On the Welcome Screen, select Import Project. Alternatively, on the main menu, select File | Import Project.
- In the dialog that opens, select a file that you want to import and click Next.
The Import Project wizard opens.
- On the first page of the wizard, choose Import project from external model, select SBT project from the list and click Next.
- On the next page of the wizard, select options that you want to apply to your project:
- Use auto-import - use this option to resolve all the changes made to the project automatically every time you refresh your project.
- Create directories for empty content roots automatically - use this option to add a
srcdirectory to your project. When you import a project the
scrdirectory is not created. When you create a project, the
srcdirectory is generated automatically.
- Click Finish.
Running and Debugging Play Application
You can run a Play application and you can easily start a debugging session using default run/debug configuration settings.
To run a Play application
- In the project tree, right-click the application.
- From the list in the context menu, select Run Play2 App.
To start a Debugging session
- Select the run/debug configuration to execute and perform either one of the following actions:
- Click the Debug button on the toolbar.
- Choose on the main menu.
- Press Shift+F9.
- Press Shift+Alt+F9, select the configuration from the pop-up menu, and press Enter.