Currently we have a project with a standard subversion repository layout of:
./trunk
./branches
./tags
However, as we're moving down the road of OSGi and a modular project, we've ended up with:
./trunk/bundle/main
./trunk/bundle/modulea
./trunk/bundle/moduleb
./tags/bundle/main-1.0.0
./tags/bundle/main-1.0.1
./tags/bundle/modulea-1.0.0
The 'build' is still quite monolithic in that it builds all modules in sequence, though I'm starting to wonder if we should refactor the build/repository to something more like:
./bundle/main/trunk
./bundle/main/tags/main-1.0.0
./bundle/main/tags/main-1.0.1
./bundle/modulea/trunk
./bundle/modulea/tags/modulea-1.0.0
In this pattern I would imagine each module building itself, and storing its binary in a repository (maven, ivy, or another path of the subversion repository itself).
Are there guidelines or 'best-practices' over project layouts once one goes modular?
A multi-module project is built from an aggregator POM that manages a group of submodules. In most cases, the aggregator is located in the project's root directory and must have packaging of type pom. The submodules are regular Maven projects, and they can be built separately or through the aggregator POM.
This project is divided into modules. Instead of putting everything into one document, each specific task is put into its own document, and the result is assembled at the end.
Advantages of a Multi-Module ProjectIt provides a great ability to build all sub-modules only with a single command. We can run the build command from the parent module. While building the application, the build system takes care of the build order. Deployment of the applications gets very convenient and flexible.
The Subversion book contains two sections on this:
A blog entry on the subject: "Subversion Repository Layout"
The short answer, though: while your mileage will vary (every situation is individual), your /bundle/<project>/(trunk|tags|branches)
scheme is rather common and will likely work well for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With