• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Best way to migrate Ant build to Maven

 
Bartender
Posts: 217
7
Android Python Oracle Postgres Database Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody give advises how to port a couple of ant builds with many targets and tasks to Maven? I am thinking about tools available that assist in this mass migration, or working procedures to organize the work. May be the effort could be put into smaller pieces/increments.
 
Saloon Keeper
Posts: 15616
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no real automated way to do it.

The most important thing to do is to determine WHY each of your tasks runs at a given time in the build. Don't try to completely mirror every Ant task, but instead write down how they influence the final result, and whether and why it is important that it is done in exactly that way. If it's not important, then it's pointless to force Maven to do it the same way.

Move your project sources to a directory layout that follows the default Maven layout. Create a very basic Maven POM. Try to build the application. Then observe how the result differs from the Ant build. Then you can slowly start adding plugins to your POM to mold the final build result.
 
Saloon Keeper
Posts: 27861
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:There's no real automated way to do it.

Move your project sources to a directory layout that follows the default Maven layout. Create a very basic Maven POM. Try to build the application. Then observe how the result differs from the Ant build. Then you can slowly start adding plugins to your POM to mold the final build result.



There's really no better advice.

If you are creating multiple products in the current Ant script, then typically you'd figure out which ones had to be built first and set up a hierarchy of POM/projects and dependencies. Avoid trying to force Maven to adhere to your current project structure. It's more trouble than it's worth and it makes later maintenance a real pain.
 
reply
    Bookmark Topic Watch Topic
  • New Topic