Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Maven Play project configuration in IntelliJ IDEA 14

Marcos Martinez edited this page May 5, 2015 · 5 revisions

This page summarizes the steps to configure IntelliJ IDEA 14 to work with Play Framework projects that have been integrated with a Maven build process using the play-cedar-service template. An example of one of this projects is: play-cedar-services-examples.

The steps are:

  1. Clone the GitHub project (e.g. $ git clone https://github.com/metadatacenter/play-cedar-services-examples.git).
  2. Go to the root of the project and execute $ mvn install.
  3. Open IntelliJ IDEA and import the project as an SBT project using the default import settings.
  4. When SBT finishes importing all the dependencies, right click on the pom.xml file at the root folder and select "Add as Maven project".

After these steps, the External Libraries category at the Project browser should contain a list of dependencies managed both by Maven and by SBT. The project is ready to be executed using IntelliJ.

Running the Tests

Right click on the test folder that you want to run and select Run > All Tests. All the JUnit tests in the folder will be executed after building ("Make") them.

If the building process is too slow, a way of speeding it up is use Maven to compile the code. In order to do that, go to Run > Edit Configurations and select the JUnit configuration that has been automatically created. In the "Before launch" field, delete the "Make" action and create a new one using the category "Run Maven goal" and the command -DskipTests=true package. This option will compile the tests using Maven before executing them, which should be faster.

Running the Play Application:

Right click on any of the Controller classes in the "cedar-services-examples-play/app/controllers" folder and select "Run Play 2 App".

Debugging

For debugging the tests or the Play Application, just choose the appropriate "Debug" option at the "Run" menu.

Clone this wiki locally