Reputation: 49077
I have separated the code that I have been making up to this point from a single maven project to multiple maven projects. The projects that I have ended up with can be used by future projects, they are pretty much libraries. I have been using a single Git repository up to this point since everything was in one project. However after the modularisation I wonder if I should create a Git repository for each Maven project. I think that is the correct way to do it, but I would like to hear what others think of that. Since the projects could work as standalone components they also deserve their own Git repository? Another option would be to develop all the projects in the same Git repository for the project that I currently work on.
Upvotes: 6
Views: 2608
Reputation: 1324268
Since the projects could work as standalone components they also deserve their own Git repository?
This is actually one of the main criteria for defining a git repo, which will represent a coherent group of file with its own independent history (including its set of branches and tags)
This has the additional advantage that some other project depending on some but not all your components won't have to clone the full unique git repo (which would contain everything, included components not needed).
That other project can clone and benefit from the exact subset of components needed.
This is called the component approach, as opposed to the system approach.
Upvotes: 2