tags:

views:

1075

answers:

5

What are the minimum steps I should follow to replace Ant with Maven?

+4  A: 
  1. Set up your project according to the standard directory layout.
  2. Create a minimal pom.xml with groupId, artifactId and version.
  3. Add your dependencies to the pom.xml

You should now be able to build a simple project, run the tests and package it.

Kjetil Ødegaard
+4  A: 

Anecdote: Once you are in Maven, the reverse trip (though why would you ever go back!) is so simple:

mvn ant:ant

generates functionally equivalent ant scripts. Now if only an Ant->Maven generator existed.

Matthew McCullough
+1  A: 

See these two posts for details:

How to Convert from Ant to Maven

Incrementally Improving a Maven build

Brian Fox
A: 

I have built an automated script to migrate Ant builds to Maven. You can find more information here:

http://erichauser.net/2009/10/26/ant2maven-easy-migration-from-ant-to-maven-with-nexus/

There is a link to the GitHub repository at the bottom which contains the script.

Eric Hauser
A: 

You can have a look to ant2maven script, that builds pom.xml from Ant scripts. I've never tried it, but it can be used to have a good pom.xml to start with...

romaintaz