• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Maven using own folder structure

 
Kailas Mushram
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My project folder structure is different from that of Maven. Can I still use Maven? If yes how?

I have folder structure like:

common-> Java files, properties, xml files
domain-> Java files, properties, xml files
web-> Java files, properties, xml files

Please provide me any soln ASAP.

Thanks in advance.

Kailas
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Maven, I would turn this into three projects: common, domain, web. The first two would each build a jar and place it into the local repository, and the last would build a war and use those jars. In addition, I would use the standard Maven directory structure for each project.

But you can change the default directory locations for things:



Note that other plugins might also need or assume these locations so there might be other things you have to change also. That is why I stick to the default locations.
[ July 24, 2008: Message edited by: Peter Johnson ]
 
Kailas Mushram
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter.

I also want to know -Do we need to stick to Maven folder structure ? like

src/main/java.....
and
src/main/resources.....

Can I still avoid using Maven folder structure.? If yes, how this can be done. If possible can you provide me -the POM.xml and project.xml contents ?

Thanks in advance.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can customize the directory structure in a Maven project, but it's no fun.

I'm not a big fan of how they laid things out myself, but at least it's standardized. So if someone dumps a (non-customized) Maven project on me, I know where to find the project's components.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I still avoid using Maven folder structure.? If yes, how this can be done. If possible can you provide me -the POM.xml and project.xml contents ?


I already answered this question and provided the pom.xml contents (yes they showed the defaults - change them to what you want).

But like Tim and I hinted at very strongly already - you are much better off accepting the defaults.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic