Convert non-launchable job to launchable job in Spring Batch Admin

509 views Asked by At

I have a Spring Batch job developed with Spring Boot (1.4.1.RELEASE).

It successfully runs from command line and writes job execution data to MySQL. It shows up as non-launchable job in Spring Batch Admin (2.0.0.M1, pointing to MySQL) and I can see job execution metrics.

Now I'd like to turn it into a launchable job so I can run it within Spring Batch Admin.

I wonder if anyone has done that before. The documentation has a section Add your Own Jobs For Launching. But it does not specify where to add the implementation jar(s) for the job?

Is it spring-batch-admin/WEB-INF/lib?

With Spring Boot, the non-launchable job is one big, all-in-one executable jar. Its dependencies overlap with Spring Batch Admin. For example, they both have spring-batch*.jar, spring*.jar but different versions.

Is there a way, like the job definition xml file, to keep them in separate contexts? Thank you.

1

There are 1 answers

3
Ashish On

Spring Batch Admin looks for your job definitions in src/main/resources/META-INF/spring/batch/jobs folder. You could add your job-definition.xml file in that folder and define your batch jobs in that xml.