Mavanagaiata works great with submodules through customized plugin executions using different settings for gitDir and other properties.
But it would be great, if there was a way to let this happen automagically, creating properties (and files) based on submodules.
For our purpose it would be fine if was not expected by default to be in the parent folder of basedir, but located by looking in the parent folder of basedir, and if not found the parent of the parent, etc. all the way to the top.
If I understand you, you're not having Git submodules, but one Git repository for several Maven projects, right?
Yes. I am still new to the Maven mindset and apparently misunderstood what you were describing. Can the current version do what I describe?
It won't work out of the box. I guess that this would work, but may require a somewhat complex configuration. You will at least need to specify the gitDir to use .git/ of the parent directory.
That is what I did, but I don't quite understand why it would not be possible to ask to search up towards the root. Ant can do it when looking for build.xml.
I didn't say that this isn't entirely impossible, but it won't work with the current version of Mavanagaiata out-of-the-box.
I just opened a new issue (#8) for this use case.
I have now tried moving the mavanagaiata configuration snippet into a parent pom (sitting a directory level above each module which need this) and the parent pom.xml is next to .git/ and the automatic search does not work with 0.4.1.
What is the proper way to do this for automatic searching of .git to work?
A parent POM won't help, because the baseDirs of the sub-projects stay the same (one level below .git).
Please try to setup the configuration as follows. You can choose to set either baseDir to the root of your repository or gitDir to .git (or both).
@ravn There was a regression in 0.4.0 which was fixed in 4b4e25a which might also affect your use case.
I am now experimenting with submodules (we essentially want a single super pom pulling in all our branches) and interestingly enough hit this exact open issue. In my case the explicitly pointed out ".git" folder has now become a .git-file containing "gitdir: ../.git/modules/DVER" which mavanagaiata dislikes causing our builds to break. Is this anyone else seeing this issue?
This is Git's new format for submodules, the actual .git folder of the submodule will reside in .git/modules/submodule of the parent repository.