This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes creating a pom for an exsisting project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "creating a pom for an exsisting project" Watch "creating a pom for an exsisting project" New topic
Author

creating a pom for an exsisting project

farhath farook
Ranch Hand

Joined: Aug 01, 2007
Posts: 37
I have a web application that was developed in a different structure to the default archtype of the mevan. And i need to write a pom for it. Is it possible to build using pom with out changing the structure of the project or do I have to change the structure according to the mevan.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

You can warp Maven to build with non-standard directory structures, but it's really expensive to do so.

It's better to re-arrange the project to be Maven-friendly. Aside from less frustration with the project itself, you gain the advantage that people will know where to find things when they work on the project as long as they're in the standard locations and not in some location unique to the project and/or shop.


Customer surveys are for companies who didn't pay proper attention to begin with.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

This question comes up often. If you want to see all of the dire warnings on why this is not a good idea, search this forum for "maven directory structure".


JBoss In Action
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2274
    
  28

One of the principles that Maven tries to follow is ConventionOverConfiguration. You should follow the same convention in all your modules, instead of having each module have it's own way of doing it, and configuring the maven to fit to that module. THis way, your pom files are smaller, and also you can find what you need in the same place every time. You don't have to go triapsing through the pom file
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: creating a pom for an exsisting project
 
Similar Threads
Is there a way to create application (ear) project from maven to eclipse?
Parent pom
Need help in Starting with Maven
Maven building ear file from war
Submodule pom's in Continuum having different SCM specs