4

I have back end Spring experience however, I don't have great experience deploying applications on web containers (for e.g Tomcat). I was able to run Spring Batch Admin using Eclipse STS tools. However, after following this I was somehow confused on how to create my own spring batch application and deploy them on tomcat and manage them from Spring Batch Admin UI.

In the Spring Batch project I created on IntelliJ I couldn't find any war files at all. I have also read the above documentation and it leads you to this so that you can download the war files. But all of the files are jar files. I am a bit confused and a step by step guide on how to create Spring Batch jobs and deploy them on Spring Batch Admin would be great. I appreciate that.

WowBow
  • 7,137
  • 17
  • 65
  • 103

1 Answers1

5

Spring Batch Admin has two ways of creating a WAR deployment as of right now:

  1. Copy the sample application and use it (https://github.com/spring-projects/spring-batch-admin/tree/master/spring-batch-admin-sample). That will provide a fully functional Spring Batch Admin web app that can be deployed to any servlet container.
  2. Embed the jar files provided by the framework into an existing web application. You can read more about this option in the getting started guide found here: http://docs.spring.io/spring-batch-admin/getting-started.html
Michael Minella
  • 20,843
  • 4
  • 55
  • 67
  • Thank you for the quick response. I have already did something similar to #1 and I am running http://localhost:8080/Batch/batch/home (batch job created within Eclipse STS tool. It has simple reader and writer). Now I wanted to create another batch job (this is not sample project but a real application) and wanted to deploy it on the Spring Batch Admin so I can run it from the UI. That's where I stuck. I have also read the link you provided on #2 but it was somehow advanced to me. – WowBow Mar 04 '15 at 20:38
  • What, *exactly*, are you looking to deploy? Just the XML definition, custom classes, ? – Michael Minella Mar 04 '15 at 20:46
  • I have only the following classes in my project: Employee(model), EmployeeFieldSetMapper, EmployeeWriter, EmployeApp (which has the job launcher and jobExecution). And I also have pom.xml and spring-config.xml in resources folder and other test classes. The app runs smoothly when I run it in IntelligIDEA (no UI . It just prints out employee details on console). I don't see any other war file, jsp or xml files and I don't know how I can deploy this in to Spring Web Admin. – WowBow Mar 04 '15 at 20:57
  • All of the UI files for Spring Batch Admin are embedded in the jar files. You just need those jar files within the /WEB-INF/lib directory and all should work. How you choose to actually create the WAR file is up to you. – Michael Minella Mar 04 '15 at 21:39
  • So to make things clear: all I have to do is bring those jar files in to /WEB-INF/lib directory to my current Batch Job project? – WowBow Mar 04 '15 at 21:55
  • Assuming that it's a web project...yes. – Michael Minella Mar 05 '15 at 01:24