Skip to content

getting started

Mahmoud Ben Hassine edited this page May 17, 2017 · 20 revisions

Prerequisite

Easy Rules is a Java library. It requires a Java runtime. The following table summarizes minimum Java versions needed for each Easy Rules version:

Easy Rules version Java version
3.x 1.8+
2.x 1.7+
1.x 1.6+

Building from source

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

Please follow these instructions :

$ git clone https://github.com/EasyRules/easyrules.git
$ cd easyrules
$ mvn install

Use with maven

Easy Rules is a single jar file with no dependencies. You have to add the jar easyrules-core-2.4.0.jar to your application's classpath.

If you use maven, add the following dependency to your pom.xml :

<dependency>
    <groupId>org.easyrules</groupId>
    <artifactId>easyrules-core</artifactId>
    <version>2.4.0</version>
</dependency>

Quick start archetype

The quick start archetype generates a skeleton project with the right dependency to Easy Rules. In order to generate a quick start project, just run the following command:

$>mvn archetype:generate \
    -DarchetypeGroupId=org.easyrules \
    -DarchetypeArtifactId=easyrules-archetype \
    -DarchetypeVersion=2.4.0

You will be asked for your project's groupId, artifactId, version and base package. Once finished, you will get a fully functional sample application that you can run with the following command:

$>mvn compile exec:java -Dexec.mainClass=${your.base.package}.Launcher

where ${your.base.package} is the value of the base package you were asked for when creating the project.