Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: scheduling a batch job

  1. #21
    Join Date
    Mar 2008
    Posts
    5

    Default BatchCommandLineLauncher in m5

    Quote Originally Posted by robert.kasanicky View Post
    One way is to use maven to launch the job - just add the snippet below to your pom.xml and use "mvn exec:exec -Djob.name=myJob -Djob.configuration.path=path/to/myJob.xml" as command (or you can hardcode the parameters).

    Code:
    <plugin>
                      <groupId>org.codehaus.mojo</groupId>
                      <artifactId>exec-maven-plugin</artifactId>
                      <executions>
                          <execution>
                              <goals>
                                  <goal>exec</goal>
                              </goals>
                          </execution>
                      </executions>
                      <configuration>
                          <executable>java</executable>
                          <arguments>
                              <argument>-classpath</argument>
                              <!-- automatically creates the classpath using all project dependencies, 
                                  also adding the project build directory -->
                              <classpath />
                              <!-- job configuration file -->
                              <argument>-Djob.configuration.path=${job.configuration.path}</argument>
                              <!-- job name -->
                              <argument>-Djob.name=${job.name}</argument>
                              <argument>
                                  org.springframework.batch.execution.bootstrap.support.BatchCommandLineLauncher
                              </argument>
                          </arguments>
                      </configuration>
                  </plugin>
    BatchCommandLineLauncher is not available in m5 that I can see. How is this done in m5 or am I missing something? Thanks!

  2. #22
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    I think it's called CommandLineJobRunner.

  3. #23
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    CommandLineJobRunner also uses command line arguments instead of VM arguments.

Posting Permissions

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