views:

117

answers:

3

Hi,

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.

A: 

If it's a large task, you could always write ant tasks in Java or Jython and call them from ant.

Jay Askren
+4  A: 

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.

Bozho
yeah, that's a good direction. But I'm still missing the copy/scp/sshexec parts that I get with Ant...
Nadav
it's done in a different way - via the exposed services by the server. Tomcat for example has the manager app, and Hudson uses it. I don't how how cargo does its job.
Bozho
+2  A: 

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:

Pascal Thivent