Vinu
Vinu

Reputation:

How can I replace Ant with Maven?

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

Upvotes: 14

Views: 8508

Answers (3)

Romain Linsolas
Romain Linsolas

Reputation: 81667

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...

Upvotes: 0

Kjetil Ødegaard
Kjetil Ødegaard

Reputation: 681

  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
  4. Compare the WAR/JAR/EAR to the old version see if there is any change. Take actions to minimize the differences as told here.

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

Upvotes: 13

Matthew McCullough
Matthew McCullough

Reputation: 17597

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.

Upvotes: 8

Related Questions