File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Using Maven using own folder structure 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 "Using Maven using own folder structure" Watch "Using Maven using own folder structure" New topic
Author

Using Maven using own folder structure

Kailas Mushram
Greenhorn

Joined: Jul 24, 2008
Posts: 2
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

Joined: May 14, 2008
Posts: 5823
    
    7

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 ]

JBoss In Action
Kailas Mushram
Greenhorn

Joined: Jul 24, 2008
Posts: 2
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

Joined: Jun 25, 2001
Posts: 16011
    
  19

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.


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

Joined: May 14, 2008
Posts: 5823
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Maven using own folder structure