-
First, you need to have MySQL installed, create the database named
trainer-plus
with an encoding set toUTF-8
-
At the root directory of the project(TrainerPlus), edit the file
conf/application.conf
using the following command (in linux)
vi conf/application.conf
- Look for the
Database Configuration
section, you should see something like ..
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
db.default.driver=org.mariadb.jdbc.Driver
db.default.url="jdbc:mysql://localhost:3306/trainer-plus?characterEncoding=UTF-8"
db.default.user=root
db.default.password=""
applyEvolutions.default=true
- Edit the
db.default.url
,db.default.user
,db.default.password
to match your database configuration, eg.
db.default.url="jdbc:mysql://localhost:3306/trainer-plus?characterEncoding=UTF-8"
db.default.user="test"
db.default.password="test1234"
-
First, download the
Play Activator
from Play Framework > The 1.3.7 minimal distribution or the 1.3.7 offline distribution -
extract the dowloaded
1.3.7 Play activator
byunzip typesafe-activator-1.3.7-minimal.zip
or (if you choose the offline distribution)
unzip typesafe-activator-1.3.7.zip
There are various solutions to run the project, choose one of the solutions that you prefer, or you can visit Play Framework Installation for more information.
For convenience, you should add the Activator installation directory to your system PATH.
On
Unix
, useexport PATH=/path/to/activator:$PATH
OnWindows
, add;C:\path\to\activator
to your PATH environment variable. Do not use a path with spaces.
-
Copy 3 files which are
activator
,activator.bat
,activator-launch-1.3.7.jar
to theTrainerPlus
directory, by(replace
activator-1.3.7-minimal
path withactivator-dist-1.3.7
if you choose the offline one)cp activator-1.3.7-minimal/activator-launch-1.3.7.jar TrainerPlus cp activator-1.3.7-minimal/activator TrainerPlus cp activator-1.3.7-minimal/activator.bat TrainerPlus
-
Move to TrainerPlus directory, run the project by executing
activator run
cd TrainerPlus ./activator run
or (if you already added PATH)
cd TrainerPlus activator run
You should see something like
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
-
Copy 3 files which are
activator
,activator.bat
,activator-launch-1.3.7.jar
to theTrainerPlus
directory, by(replace
activator-1.3.7-minimal
path withactivator-dist-1.3.7
if you choose the offline one)cp activator-1.3.7-minimal/activator-launch-1.3.7.jar TrainerPlus cp activator-1.3.7-minimal/activator TrainerPlus cp activator-1.3.7-minimal/activator.bat TrainerPlus
-
Move to TrainerPlus directory, run the project by executing
activator universal:packageZipTarball
cd TrainerPlus ./activator universal:packageZipTarball
It should create file
target/universal/trainer-2.5.1.tgz
(name is depends onbuild.sbt
) -
Extract and run the created app by
tar xf target/universal/trainer-2.5.1.tgz target/universal/trainer-2.5.1/bin/trainer