Results 1 to 6 of 6

Thread: spring-batch hello world

  1. #1
    Join Date
    Aug 2007
    Posts
    4

    Default spring-batch hello world

    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

  2. #2
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    Quote Originally Posted by guenni View Post
    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).

    Quote Originally Posted by guenni View Post
    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...".

  3. #3
    Join Date
    Sep 2004
    Posts
    602

    Default

    Quote Originally Posted by Dave Syer View Post
    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.sp...ramework/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 ?

  4. #4
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    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.

  5. #5
    Join Date
    Dec 2007
    Posts
    9

    Default Hello world

    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.

  6. #6
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •