Important Points for setup Play Project
Create the new play project using follwoing command:
$ play new project_name
For detail information got to this link: https://www.playframework.com/documentation/2.0/NewApplication
For using eclipse IDE with play project there are some important and basic points as follow:
Note: For setting eclipse for Play click on this link: https://www.playframework.com/documentation/2.2.x/IDE
- You need to create eclipse settings files for project using following command:
$ project-dir> play eclipse
- When ecilipse files are created successfully, import the project as follow in eclipse:
import > General > Existings Project Into Workspace
#####There are some points, we need to discuss for setup this sample application.
Perform CRUD Operations using Play-Framework with Spring Depedency Injectionproject using
- In this project we are using H2 embedded database. For create database first time, go to project
conf/application.conffile and uncomment the
evolutionplugin=disabledline and save the file.
- Now run the following command:
$ project_dir> play clean compile $ project_dir> play run
- Your database are created successfully in project directory.
- If you want to check you database, stop the application and run the following command:
$ project_dir> play
- Your playframework is start and the run following commands as below:
[project_dir] $ [project_dir] $ h2-browser
- Your browser is open and select
Generic Serverand enter username and password.
Note: Please check conf/application.conf file for db cridentials and settings.
- After create the database comment the
conf/application.conffile, because if we not comment, every time when application is start the play-framework create database new and your previous data is lost.
- Unmanaged Dependencies: In SBT, when we need to add unmanaged dependencies, create lib folder on the root of the project and add all unmanaged dependencies.
- Play Eclipse Debug Config:
- Go to project Debug-Configurations.
- select Remote-Java-Configuration.
- Create new configuration add Name and Select "Connect" tab
- Select project
- Connection Type: Standard (Socket Attach)
- Connection Properties: HOST(localhost), PORT(9999) -Click on Apply
- Run command
play debug run.
- Run debug configurations and add the breakpoints and hit the url.
Note: When importing the project into eclipse and you got the errors in your source code and templates. Please use the following link : http://stackoverflow.com/questions/28104968/scala-ide-4-0-0-thinks-theres-errors-in-an-out-of-the-box-play-framework-2-3-7