How to convert Ant project to Maven project

adelarsq picture adelarsq · Oct 27, 2010 · Viewed 36.5k times · Source

How to convert a Ant project to Maven project? A sample project that would link (a Wicket project)

Thanks

Answer

Sean Patrick Floyd picture Sean Patrick Floyd · Oct 27, 2010

The nice part of using maven is that most standard stuff works automatically once you do things the maven way. For a simple webapp:

  1. Create a pom with groupId, artifactId and version (packaging: war)
  2. Add the required dependencies to the pom
  3. move the
    • java sources to src/main/java,
    • resources to src/main/resources,
    • webapp content to src/main/webapp,
    • test content to src/test/java and src/test/resources
  4. set the compiler compliance version using the maven compiler plugin

That should get you up 'n' running.