01
Oct
11

Hello World With Spring Batch 2.1.x


This page describes how convert the spring hello world example application to work using spring batch 2.1.x.

Background

The Hello World With Spring Batch was written a while ago. Since then there was a new version of spring batch released. Instead of changing the original article, I chose to write a new one just describing the changes needed to get the application described there to work.

The original article is located here:

http://numberformat.wordpress.com/2010/02/05/hello-world-with-spring-batch/

Step 1

Update the pom.xml dependency for spring-batch-core.

pom.xml

        <dependency>
            <groupId>org.springframework.batch</groupId>
            <artifactId>spring-batch-core</artifactId>
            <version>2.1.8.RELEASE</version>
        </dependency>

Step 2

update the xml:

src/main/resources/simpleJob.xml


http://www.springframework.org/schema/batch/spring-batch-2.0.xsd">

with


http://www.springframework.org/schema/batch/spring-batch-2.1.xsd">

Finally Run the command just like before:

mvn clean compile exec:java -Dexec.mainClass=org.springframework.batch.core.launch.support.CommandLineJobRunner -Dexec.args="simpleJob.xml helloWorldJob"

That’s all for now!

About these ads

1 Response to “Hello World With Spring Batch 2.1.x”



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 49 other followers

%d bloggers like this: