View Full Version : spring-batch hello world
guenni
Sep 2nd, 2007, 12:58 PM
Hi,
thanks one more time for your patience.
I suppose Maven is a wonderful tool once you have a clue what you're doing, but I'm slowly getting there.
So after many many tries I finally created an empty maven project within eclipse added the repository you mentioned and added the dependency to batch-execution and everything seems to be shiny :).
Uff!
Now within the next week or so I hope to be able to do my first spring-batch hello world. Any tip for me
a) how to get maven to attach the sources, the jars seem to be there
b) how to get started with a hello world?
Günther
Dave Syer
Sep 2nd, 2007, 04:46 PM
a) how to get maven to attach the sources, the jars seem to be there
If you are using Eclipse get the Maven plugin (I think you said you already have it). In Windows->Preferences->Maven check the "download sources" box. I think that's what it is called (from memory).
b) how to get started with a hello world?
Use one of the samples as a starting point? The User Guide is a bit behind the curve but they are quite self-explanatory. Mostly they use JUnit as a launcher, but there is also an Eclipse launcher called jobLauncher.launch in teh root of the samples project, which uses the BatchCommandLineLauncher to run a sample job. If you use the default Eclipse project names (same as directory names) in your workspace, it should show up in your "Run Dialogue...".
Paul Newport
Sep 4th, 2007, 09:35 AM
If you are using Eclipse get the Maven plugin (I think you said you already have it). In Windows->Preferences->Maven check the "download sources" box. I think that's what it is called (from memory).
For various reasons I am in the position of not being able to use Maven to check out and build Spring Batch.
I would therefore just like to download pre-built jars and go from there.
I have obtained the following from here http://s3browse.com/explore/maven.springframework.org/snapshot/org/springframework/batch
spring-batch-core-1.0-m2-20070822.073953-4.jar
spring-batch-core-1.0-m2-20070822.073953-4-sources.jar
spring-batch-execution-1.0-m2-20070822.073953-4.jar
spring-batch-infrastructure-1.0-m2-20070822.073953-4.jar
spring-batch-integration-1.0-m2-20070822.073953-4.jar
spring-batch-samples-1.0-m2-20070822.073953-4.jar
spring-batch-samples-1.0-m2-20070822.073953-4-sources.jar
But I cannot find any test cases to run the samples, nor the class AbstractLifecycleSpringContextTests in any of the above jar files.
Is there a jar I am missing ?
lucasward
Sep 4th, 2007, 10:30 AM
Because JUnit is used to run all the sample jobs, they are located in src/test/java, which won't be added to any jars maven creates. You mentioned that you can't use maven to build, can you still use subversion to check the code out? If so, and you absolutely can't use maven, you could then construct the dependencies of the project using the pom files by manually downloading and adding them to the classpath. Even if you use the created jars, you'll still need to do this step anyway if you can't use maven to download them for you.
neetu
Dec 13th, 2007, 06:21 AM
can u provide a simple application for beginers to understand without using DAO or any other components.The sample application provided(containing examples of football job and order job) is difficult to interpret.
Dave Syer
Dec 15th, 2007, 09:49 AM
What about adhocLoopJob.xml or simpleTaskletJob.xml? It doesn't get much simpler. How do you expect a job to do anything without a data access layer? N.B. we recommend using the ItemProviderProcessorTasklet (or subclasses).
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.