<p>I have a large application (~50 modules) using a structure similar to the following:</p>

<ul>
<li>Application  

<ul>
<li>Communication modules

<ul>
<li>Color communication module</li>
<li>SSN communication module</li>
<li>etc. communication module</li>
</ul></li>
<li>Router module</li>
<li>Service modules

<ul>
<li>Voting service module

<ul>
<li>Web interface submodule for voting</li>
<li>Vote collector submodule for voting</li>
<li>etc. for voting</li>
</ul></li>
<li>Quiz service module</li>
<li>etc. module</li>
</ul></li>
</ul></li>
</ul>

<p>I would like to import the application to Maven and Subversion. After some research I found that two practical approaches exists for this.</p>

<p>One is using a tree structure just as the previous one. The drawback of this structure is that you need a ton of tweaking/hacks to get the multi-module reporting work well with Maven. Another downside is that in Subversion the standard trunk/tags/branches approach add even more complexity to the repository.</p>

<p>The other approach uses a flat structure, where there are only one parent project and all the modules, submodules and parts-of-the-submodules are a direct child of the parent project. This approach works well for reporting and is easier in Subversion, however I feel I lose a bit of the structure this way.</p>

<p>Which way would you choose in the long term and why?</p>

[{'answer_id': 20681, 'author': 'Mike Deck', 'author_id': 1247, 'author_profile': 'https://Stackoverflow.com/users/1247', 'pm_score': 2, 'selected': False, 'text': "<p>I think you're better off flattening your directory structure.  Perhaps you want to come up with a naming convention for the directories such that they sort nicely when viewing all of the projects, but ultimately I don't think all of that extra hierarchy is necessary.</p>\n\n<p>Assuming you're using Eclipse as your IDE all of the projects are going to end up in a flat list once you import them anyway so you don't really gain anything from the additional sub directories.  That in addition to the fact that the configuration is so much simpler without all the extra hierarchy makes the choice pretty clear in my mind.</p>\n\n<p>You might also want to consider combining some of the modules.  I know nothing about your app or domain, but it seems like a lot of those leaf level modules might be better suited as just packages or sets of packages inside another top level module.  I'm all for keeping jars cohesive, but it can be taken too far sometimes.</p>\n"}, {'answer_id': 20682, 'author': 'Boris Terzic', 'author_id': 1996, 'author_profile': 'https://Stackoverflow.com/users/1996', 'pm_score': 5, 'selected': True, 'text': '<p>We have a largish application (160+ OSGi bundles where each bundle is a Maven module) and the lesson we learned, and continue to learn, is that flat is better. The problem with encoding semantics in your hierarchy is that you lose flexibility. A module that is 100% say "communication" today may be partly "service" tomorrow and then you\'ll need to be moving things around in your repository and that will break all sorts of scripts, documentation, references, etc.</p>\n\n<p>So I would recommend a flat structure and to encode the semantics in another place (say for example an IDE workspace or documentation).</p>\n\n<p>I\'ve answered a question about version control layout in some detail <a href="https://stackoverflow.com/questions/16829/structure-of-projects-in-version-control#16915">with examples at another question</a>, it may be relevant to your situation.</p>\n'}]
['https://Stackoverflow.com/questions/20003', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/686/']