Spring-Batch Tutorial - PowerPoint PPT Presentation

About This Presentation
Title:

Spring-Batch Tutorial

Description:

Manually install to local maven repository: mvn ... path/to/file. Create a batch application. Use the spring-batch-app archetype. mvn archetype:create ... – PowerPoint PPT presentation

Number of Views:1909
Avg rating:3.0/5.0
Slides: 8
Provided by: jiraSpring
Category:

less

Transcript and Presenter's Notes

Title: Spring-Batch Tutorial


1
Spring-Batch Tutorial
  • Getting Started Guide

2
Agenda
  • Software prerequisites
  • Creating new batch application
  • Setting up database
  • Running a job

3
Prerequisites
  • JDK 1.4 or later
  • Maven 2

4
Checkout install the framework
  • svn checkout https//springframework.svn.sourcefo
    rge.net/svnroot/springframework/spring-batch/tru
    nk spring-batch
  • cd spring-batch
  • mvn install

5
Download Install framework
  • Download snapshot from http//static.springframewo
    rk.org/spring-batch/snapshots.html
  • Manually install to local maven repositorymvn
    installinstall-file -DgroupIdorg.springframewor
    k.batch -DartifactIdspring-batch-execution
    -DversionM3-SNAPSHOT -Dpackagingjar
    -Dfile/path/to/file

6
Create a batch application
  • Use the spring-batch-app archetype
  • mvn archetypecreate
  • -DarchetypeGroupIdorg.springframework.batch
  • -DarchetypeArtifactIdspring-batch-app
  • -DarchetypeVersion1.0-SNAPSHOT
  • -DgroupIdorg.myorganization
  • -DartifactIdmy-app-name

7
Setup the database
  • Create a schema using SQL script
    from/src/main/resources/db-schema-scripts
  • Edit JDBC connection properties
    in/src/main/resource/batch-jdbc.properties

8
Run a job
  • cd path/to/my-app-name
  • mvn test
  • mvn execexec

9
Look behind the curtains
  • src/main/resources/helloWorldJob.xml contains the
    job configuration
  • pom.xml contains the mavens exec plugin
    configuration which launches the job with
    appropriately configured classpath
Write a Comment
User Comments (0)
About PowerShow.com