Reputation: 11513
I need some advice on how to configure multiple repo's such that they share a Maven parent and also are configured as submodules in a Maven root project.
I'm maintaining open source project Simple Java Mail and as there are optional functions that are becoming larger and larger, I'm planning to split the project up into sub-modules each in there own GIT repo.
..\submodule-xyz
relative folders.I have configured a similar setup before, but that was all in a single repository (in the good old Subversion days). Can anyone please advise on how to approach this best with split up repo's? Preferably I would have one repo for the parent pom and the main/root pom (is that common?). Is it preferable to combine with git submodules?
Upvotes: 5
Views: 9875
Reputation: 1330082
The term module is a bit overloaded here.
Yes, you can define in one repo a parent pom, declaring a multi-module maven project, each module referring to a subfolder.
Those subfolders can be created through git submodule add
command, referencing each a remote repository where the sub-project is versioned.
The subfolders are relative to the root folder of the parent directory, but should not need ../
.
Each submodule repo can have its own pom.xml
, which would reference the main project pom as a parent pom.
Upvotes: 10