Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

getting started

Mahmoud Ben Hassine edited this page Nov 19, 2020 · 6 revisions

Prerequisite

Easy Jobs requires a Java 1.8+ runtime.

Building from source

To build Easy Jobs from sources, you need to have git and maven installed and set up.

Please follow these instructions :

$ git clone https://github.com/j-easy/easy-jobs.git
$ cd easy-jobs
$ mvn install -DskipTests

Currently, tests require each supported database server to be running. It is planned to use test containers to start a docker container for each database server in test phase.

Download distribution

Easy Jobs is released in a single distribution file that you can get from the releases page. Download the latest release and unzip it. You should get a directory with the following content:

$>cd easy-jobs-dist-0.4
$>tree -d
├── conf
├── drivers
│   ├── h2
│   └── mysql
├── jobs
└── lib

The distribution contains the following directories:

  • conf: contains configuration files templates.
  • lib: contains core jars of Easy Jobs server
  • drivers: contains the driver of each supported database
  • jobs: contains jars of the jobs you want to run.

Run the job server

To run the server, you can use the following command:

java -cp "drivers/h2/*:lib/*" \
 -Deasy.jobs.database.config.file=$(pwd)/conf/database.properties \
 -Deasy.jobs.database.config.init=true \
 -Deasy.jobs.server.config.jobs.directory=$(pwd)/jobs \
 -Deasy.jobs.server.config.jobs.descriptor=$(pwd)/conf/jobs.yml \
 org.jeasy.jobs.server.JobServer

If you are on windows, use the following command:

java -cp "drivers/h2/*;lib/*" ^
 -Deasy.jobs.database.config.file=%cd%\conf\database.properties ^
 -Deasy.jobs.database.config.init=true ^
 -Deasy.jobs.server.config.jobs.directory=%cd%\jobs ^
 -Deasy.jobs.server.config.jobs.descriptor=%cd%\conf\jobs.yml ^
 org.jeasy.jobs.server.JobServer

In the previous command, H2 database is used. H2 is fine for testing but not recommended for production use. You can choose another supported database by including its driver in the classpath instead. For example, to use MySQL, run the following command:

java -cp "drivers/mysql/*:lib/*" \
 -Deasy.jobs.database.config.file=$(pwd)/conf/database.properties \
 -Deasy.jobs.database.config.init=true \
 -Deasy.jobs.server.config.jobs.directory=$(pwd)/jobs \
 -Deasy.jobs.server.config.jobs.descriptor=$(pwd)/conf/jobs.yml \
 org.jeasy.jobs.server.JobServer