Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What would you use for deployment scripts in Java?

I'm working on a Java web project that uses Maven to build its artifacts. At the end of the Maven build we have a few jar and war files that we need to deploy onto our development/testing environment.

Right now we're using a pretty hefty Ant script that performs several tasks (on both Windows/Linux machines)

  • Starts/Stops services
  • Copies/deletes files
  • Builds some stuff and then executes it
  • Etc

Ant does the job well - but the script is quickly getting very large, and to be honest, it feels inadequate for the task at hand.

Are there other alternatives? I've heard of gant, but I'm not sure that's the right way to go.

Thanks for helping!

EDIT: after more research, I found out about Gradle - it seems like a very good combination of reusing ant tasks and allowing real scripts to run. It's worth a read.

like image 937
Nadav Avatar asked May 22 '10 12:05

Nadav


People also ask

What are deployment scripts?

An Apps Script project deployment is a version of the script that is made available for use as a web app, add-on, or API executable. By creating and managing deployments, you can iterate on your code, keep track of your changes, and control the exact code version your users have access to.

How is deployment done in Java?

To deploy your Java Web Start application, first compile the source code, package it as a JAR file, and sign the JAR file. Java Web Start applications are launched by using the Java Network Launch Protocol (JNLP). Hence, you must create a JNLP file to deploy your application.


2 Answers

Yes, take a look at the Cargo plugin for maven:

* Deploying to a running container
* Generating a container configuration deployment structure
* Merging WAR files
* Starting and stopping a container

Hudson - a continuous integration engine - can be used to achieve these tasks as well.

like image 63
Bozho Avatar answered Nov 07 '22 00:11

Bozho


Deployment in general is not easy (and often very specific) and while the Cargo maven plugin may help for the remote deployment of war/ear (if remote deployment for your app server is implemented), I don't think it will cover all your needs. Actually, it's hard to be very precise as the question is vague so I'll just give some pointers. Have a look at solutions like:

  • Chef
  • SmartFrog
  • ControlTier
like image 22
Pascal Thivent Avatar answered Nov 07 '22 00:11

Pascal Thivent