Tags

, , ,


1. Tips:

Install your play framework in directory name without white space:

2. Creating a New Project

To create a new project in Play you need to follow the following steps:

1. Open CMD and go to your play installation directory.

clip_image001

2. Create a new play Project and continue with option and Have fun!

clip_image002

Now, the project is created. Our next task is to make the project available in Intellij IDE.

3. Installing Play Plugin in Intellij

Before we open the project in Intellij, we need to add Play2.0 plugin in Intellij. Notice that, intellij already has Play1.0 plugin.

It can be done from the settings menu under file Menu or from Intellij open dialog.

clip_image004

1. Select Configure and then Select Plugins

clip_image006

2. Click on Install JetBrains Plugin: Select Play 2.0 support and Scala Support and Install

clip_image008

clip_image010

4. Making Project in Intellij

1. Go to your newly created Project Folder in CMD: cd TestPlayProject

2. Type in CMD : play idea

clip_image012

3. Now open the project in Intellij

clip_image013

Now we have our project opened in Intellij.

clip_image014

5. Creating Build Configuration in Intellij

1. Go to Run Menu and Select Edit Configuration and Click on “+” Button

clip_image015

2. Select Play 2 App and name the Build Configuration

clip_image017

6. Creating Build Configuration in Intellij

Now we will add required modules. We can see there is some error in the projects:

clip_image019

Here I will add two example modules, Scala and JPA.

To Add Modules:

1. Go to File Menu and the Project Structure Menu:

clip_image021

2. Click on the “Modules” and Select “+” to add Modules: Scala and Java

clip_image023

For Scala, add Language Level and Compiler Library. For JPA select Hibernate or suitable Provider. Then click apply.

3. Now We can compile the project. For first compile we need to compile the project in CMD. Type: Play Compile

clip_image024

4. Now We can Run the Project without any Error : Type : play run

clip_image025

5. To Test Project Run : go to browser and type url : http://lcoalhost:9000

clip_image026

NOTE:

1. If there is any error in framework, use command : Play clean-all

Advertisements