7

I am quite new to java applications in a production environment and have never deployed.

I have an application that connects to a mysql database, reads in data, preforms some NLP and other data manipulation, then saves the data back to the mysql DB.

The application is to be deployed on a rackspace cloud server and run every couple of hours (maybe with a cron job?).

I've been looking into using maven to help with the build for deployment, but I have no idea if that is the right tool to use or if to build a .war or .jar.

2
  • if you want to deploy application I assume you've have it built and production ready right? Or you haven't got to that part yet? Commented Aug 16, 2012 at 23:48
  • Yes, the initial version of the application is written and ready to be deployed. Commented Aug 17, 2012 at 0:03

2 Answers 2

4

Basics - Deploy as an executable Jar if at all possible (or some kind of executable container). Will simply make your life simpler when it comes to things like setting up the class path.

I've not used Maven before, but we are looking into to help us manage a rather large and cumbersome dependency chain. As I understand, Maven's build process is rather good, but again, I've never used it.

Sign up to request clarification or add additional context in comments.

2 Comments

Cool, so a jar file over war. That is a solid start! Do you know if there is any issue with running a jar file via a cron job? I've only ever used cron jobs for browser calls, but I assume they can make any command line call, right? Thanks!
There shouldn't be any issues, so long as you can setup the command line correctly. You will want to test this manually (ie run the command from the context of cron) and on a test machine to make sure, obviously ;P
1

If your project is simple, better go with a small Apache Ant script to build it. Use the generated jar and put it in a location in the server. Use a small unix shell script to trigger the main class in the jar. Add this script to the cronjob.

PS: Since this is production, please have a deployment plan ready with all the steps to follow. Example:

  1. Login to server with so and so username
  2. cd /path/to/the/jar
  3. cp xxx.jar /deployment/path/bin
  4. crontab ... etc etc..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.