-
Notifications
You must be signed in to change notification settings - Fork 124
Getting Started
tobiasflohre edited this page Apr 23, 2014
·
9 revisions
- As long as we haven't released spring-boot-starter-batch-web to Maven central, you'll need to get it from Github and build it locally.
- Create a Spring Boot maven project. Take a look at this example, it's pretty much just using spring-boot-starter-parent as a parent und adding the Spring Boot build plugin. Then add the dependency to spring-boot-starter-batch-web like in the example.
- Add a batch job. You may define it in XML and put it into META-INF/spring/batch/jobs (overridable via property batch.config.path.xml) or in JavaConfig and put it into the package spring.batch.jobs (overridable via property batch.config.package.javaconfig). Each XML file or class annotated with @Configuration in the specified locations will get its own child ApplicationContext.
- Add an entry point to the application, a class with a main method invoking SpringApplication.run(...). Take a look at this example.
- Build the application via maven package. Then start the application using java -jar xxx.jar.
Default port is 8080. Take a look at the JavaDoc of these controllers to get to know the endpoints for starting jobs etc.: JobOperationsController and JobMonitoringController.