Skip to content

Maven setup

Core

  • Allows the build of triggers
  • the execution of tasks
  • Adds also REST APIs to manage triggers and list existing tasks
1
2
3
4
5
<dependency>
    <groupId>org.sterl.spring</groupId>
    <artifactId>spring-persistent-tasks-core</artifactId>
    <version>x.x.x</version>
</dependency>

Setup Spring for Core

1
2
3
@SpringBootApplication
@EnableSpringPersistentTasks
public class ExampleApplication {

Include corresponding annotation if you use:

  • @EntityScan ->@EnableSpringPersistentTasksEntityScan
  • @EnableJpaRepositories -> @EnableSpringPersistentTasksJpaRepositories
  • @EnableEnversRepositories ->@EnableSpringPersistentTasksJpaRepositories

They break the spring auto configuration.

DB using liquibase

Dependency needed to setup the DB using liquibase

1
2
3
4
5
<dependency>
    <groupId>org.sterl.spring</groupId>
    <artifactId>spring-persistent-tasks-db</artifactId>
    <version>x.x.x</version>
</dependency>

Option 1: Just include the master file

<include file="spring-persistent-tasks/db.changelog-master.xml" />

Option 2: import changesets on by one

<include file="spring-persistent-tasks/db/pt-changelog-v1.xml" />

Enable a SPA management UI

This dependency adds a spring react default UI to /task-ui. Assuming at least an instance of the spring persistent tasks is available on this node.

1
2
3
4
5
<dependency>
    <groupId>org.sterl.spring</groupId>
    <artifactId>spring-persistent-tasks-ui</artifactId>
    <version>x.x.x</version>
</dependency>

Setup Spring Boot for the UI

1
2
3
4
@SpringBootApplication
@EnableSpringPersistentTasks
@EnableSpringPersistentTasksUI
public class ExampleApplication {