Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

custom project structure in Maven

Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

How can i create my own project structure through maven.


my own folder structure. how can achieve this.

Thank your,

Saloon Keeper
Posts: 25461
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like you, I don't really like Maven's project structure all that much. But there a several reasons why we recommend not trying to setup one's own project structure instead.

One of the main ones is simply that - ugly as it is - it's a standard. So if you take the money and run, whoever comes after you can come up to speed fairly fast on the project, knowing where things are without having to know your own personal preferences in file locations.

But you may not care about that one. A more selfish one is that it's a royal pain to implement. You have to forcibly override all the various plugins and mojos, since by default they are all assuming that you've adhered to the standard project structure. It's a lot more expensive to set up and maintain, and anyone else who might come in on the project is probably going to hate you.
Posts: 5856
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll echo what Tim said, though I do like the basic directory structure (though there are a few things that could be improved). But trying to change it is a sure way to cause all kinds of aggravation and grief. If you have an existing project with that directory structure, I recommend that you create a new Maven project and copy your sources files to their corresponding locations in the new directory structure.

I notice that you have "client" and "server" as directories. Are you actually building two different JARs? If so, you should have two projects, one for each. Maven likes to enforce one artifact per POM.

By the way, I have sent the past 6 months moving over a set of projects from quasi-Ant/Eclipse builds to Maven (where the build was done manually), and that involved redoing the directory structure for most projects and splitting many of the projects into multiple projects. Everyone on the project team quickly picked up the new directory structure, and builds are now automated with Jenkins.
rubbery bacon. crispy tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic