Follow this to write a simple and complete job.
Create a Maven project that contains:
A Java class: src/main/java/com/acme/samples/DumbJob.java
.
A configuration xml: src/main/resources/conf/portal/configuration.xml
.
Here is the pom.xml
:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme.samples</groupId>
<artifactId>dumb-job</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.1.7</version>
<scope>provided</scope>
</dependency>
<!-- You need this dependency because you'll use eXo Log -->
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
<version>2.4.13-GA</version>
</dependency>
</dependencies>
<build>
<finalName>dumb-job</finalName>
</build>
</project>
eXo Kernel makes it easier to work with Job Scheduler service. All you need is to define your Job implementation and add configuration for it.