File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom project structure in Maven

 
praneeth ram
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

How can i create my own project structure through maven.

myproj
-----src
-------java
-----target
-----client
-----server
-----clientxmlfiles
--------------abc.xml
--------------123.xml


my own folder structure. how can achieve this.

Thank your,
Praneeth.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 17622
39
Android Eclipse IDE Linux
  • 1
  • Mark post as helpful
  • send pies
  • 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.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic