IntelliJ IDEA 13.1.0 Web Help

IntelliJ IDEA supports integration with Play Framework 2.x.

Prerequisites

Note

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.

To create a play application
  1. On the Welcome Screen, select Create New Project. Alternatively, on the main menu, select File | New Project.
  2. 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.
  3. 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
  1. On the Welcome Screen, select Import Project. Alternatively, on the main menu, select File | Import Project.
  2. In the dialog that opens, select a file that you want to import and click Next.
    The Import Project wizard opens.
  3. On the first page of the wizard, choose Import project from external model, select SBT project from the list and click Next.
  4. 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.
  5. 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.

For more information, see Running and Debugging the applications.

To run a Play application
  1. In the project tree, right-click the application.
  2. From the list in the context menu, select Run Play2 App.
To start a Debugging session
  1. Select the run/debug configuration to execute and perform either one of the following actions:
    • Click the Debug button debug on the toolbar.
    • Choose Run | Debug on the main menu.
    • Press Shift+F9Shift+F9Shift+F9Shift+F9Shift+F9Shift+F9Alt+F5Ctrl+F5Shift+Alt+D or Shift+F9Control DShift F9Command F11.
  2. Press Shift+Alt+F9Shift+Alt+F9Shift+Alt+F9Shift+Alt+F9Shift+Alt+F9Shift+Alt+F9Shift+Alt+F9Shift+Alt+F9Shift+Alt+F9Control Alt DShift Alt F9Control Alt D, select the configuration from the pop-up menu, and press Enter.

See Also

Concepts:

Reference:

External Links:

Web Resources: