Java Reference
In-Depth Information
<project_home>/src/main/java/example : This directory contains sample readers
and writers that you don't need in this project.
<project_home>/src/main/java/test : You don't use the DataSourceInitializer to
initialize the database schema for this project, and it isn't recommended for use in
<project_home>/src/main/resources/META-INF/spring : As you have throughout
the topic, you configure the job XML files in the directory
<project_home>/src/main/resources/jobs , so this directory and its contents aren't
<project_home>/src/test/java/example : Because you deleted the example
ItemReader and ItemWriter included in the shell, you don't need their unit tests.
<project_home>/src/test/resources/test-context.xml : You do the required
configuration for the unit tests slightly differently than using this file, so it isn't
With the project now much leaner, you still need to do a bit more pruning. Specifically, the launch-
context.xml file has a reference to the DataSourceInitializer that you need to remove now that your
project no longer includes that class.
After you've removed the pieces that won't be used in the project, you should update some of the
remaining files. Specifically, you should update the POM file to use Spring 3 and add the MySQL driver
dependency. You also need to remove the reference to the DataSourceInitializer from the launch-
context.xml file because you deleted it earlier.
Let's start with the POM file updates. Spring does a good job of abstracting the versions of the
frameworks you're using, so changing the version of Spring you use requires that you update the
spring.framework.version property located near the top of the POM file. Listing 10-1 shows the update
you need to make.
Listing 10-1. Updating the Spring Version to Spring 3
You also need to add the MySQL driver to the POM file because, as mentioned earlier, you use
MySQL for the project. Listing 10-2 shows the Maven dependency you need to add to the POM file.
Listing 10-2. MySQL Maven Dependency
Search WWH ::

Custom Search