Results 1 to 2 of 2

Thread: How to run a simple spring batch program without using maven

  1. #1
    Join Date
    Mar 2009
    Posts
    6

    Question How to run a simple spring batch program without using maven

    Hi-

    I found most examples uses maven and the spring batch sample runs from junit/easymock.
    in the spring batch getting starts, it says
    With Eclipse and without Maven

    To launch a job from the command line instead of a unit test use the CommandLineJobRunner.main() method (see Javadocs included in that class).--> what does this mean?

    How can I compile and run in eclipse w/o using maven to build the jar and run from junit case?

    can spring batch job launched from main() method
    public static void main(String[] args) {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext .xml", MyClass.class);
    }
    many thanks.

  2. #2
    Join Date
    Feb 2008
    Posts
    488

    Default

    The CommandLineJobLauncher has a main() method. It is the class that you should use from the command line to launch a job.

    Maven is useful for downloading all of the JARs on which Spring Batch is dependent. If you do not want to use Maven, then you can acquire the JARs yourself. Check out the *-with-dependencies.zip downloads from [1] or [2].

    [1] http://static.springframework.org/do...?project=BATCH
    [2] http://static.springframework.org/do...?project=BATCH

Posting Permissions

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