Book Image

SPRING COOKBOOK

Book Image

SPRING COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Spring Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing and configuring Spring Batch


Spring automatically saves some metadata (start time, end time, and status) about jobs and their steps in a job repository, which consists of several database tables. In this recipe, we'll create these tables. We will also create a Spring configuration class dedicated to batch jobs.

How to do it…

Here are the steps to install and configure Spring Batch:

  1. Add the Maven dependencies for Spring Batch in pom.xml:

    <dependency>
        <groupId>org.springframework.batch</groupId>
        <artifactId>spring-batch-core</artifactId>
        <version>3.0.2.RELEASE</version>
    </dependency>
    
    <dependency>
        <groupId>org.springframework.batch</groupId>
        <artifactId>spring-batch-infrastructure</artifactId>
        <version>3.0.2.RELEASE</version>
    </dependency>
  2. Add the Maven dependencies for Spring JDBC and Spring Transaction in pom.xml:

    <dependency>
      <groupId>org.springframework...