File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

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: 17417

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.

An IDE is no substitute for an Intelligent Developer.
Peter Johnson

Joined: May 14, 2008
Posts: 5852

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
Saloon Keeper

Joined: Jan 17, 2008
Posts: 2746

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
I agree. Here's the link:
subject: creating a pom for an exsisting project
It's not a secret anymore!