IntelliJ IDEA supports integration with Play Framework 2.x.
Before you start creating a Play 2 project, make sure that the latest Scala plugin version and the Play Framework plugin version 2.x are 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 routes files
- 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.
- 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.
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.
- 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 src directory to your project. When you import a project the scr directory is not created. When you create a project, the src directory 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.
- In the project tree, right-click the application.
- From the list in the context menu, select Run Play2 App.
- 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 or .
- Press Enter. , select the configuration from the pop-up menu, and press