Add an option to obtain properties from a user specified directory
Git allows to obtain properties for a specified directory. Such option would allow multi module projects to get version number / build number based of the last git commit in the module itself, and not based on the last git commit of the whole git project.
Enable per module versions #136 https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/136
Hello, thank you very much for attempting to fix a very old issue on this project. Could you perhaps elaborate on your use-case for those changes?
To be honest I'm not even so sure if #136 is still an open issue. In specific I don't understand the difference to 'accepting multiple repositories' (outlined in https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/137#issuecomment-418144756). When seeing #136 as run the plugin on every submodule it raises question how the git prefix should be altered across projects (otherwise they would cancel each other out when we inject the properties into other projects) and it would create a conflict with the runOnlyOnce-idealogy (one would need to get a warning that combining the two doesn't make sense).
Hello, thank you very much for attempting to fix a very old issue on this project. Could you perhaps elaborate on your use-case for those changes?
Hello, thank you for taking the time to see my pull request.
In our case, we have a multi module project that looks like this:
module1 -pom.xml module2 -pom.xml ... moduleN -pom.xml pom.xml (the parent pom, also contains <modules> section with list of our modules)
We decided to include date and time of last change of module to the name of the module artefact. So the module jar (or war) file name should look like this module1-YYYYDDMM-HHMMSS.jar, where YYYYDDMM-HHMMSS is the date and time of the last commit in the module1 folder.
By default I get the date and time of the last commit in the repository, not in the module folder.
Maybe I missed something in the documentation and I can get this behavior using configuration?
Just out of curiosity:
Where is your .git-folder or folders?
Does it look like:
+--- module1
| +--- pom.xml
| \--- `.git`
+--- module2
| +--- pom.xml
| \--- `.git`
....
+--- moduleN
| +--- pom.xml
| \--- `.git`
+---- pom.xml (the parent pom, also contains <modules> section with list of our modules)
\--- `.git` (root git directory)
and for each module you would like to get the date and time of last change related to the corresponding .git directory inside the module dir? So in practice you'd have N modules and thus N different timestamps?
Or really just one extra .git directory 'under' module1 like:
+--- module1
| +--- pom.xml
| \--- `.git`
+--- module2
| \--- pom.xml
....
+--- moduleN
| \--- pom.xml
+---- pom.xml (the parent pom, also contains <modules> section with list of our modules)
\--- `.git` (root git directory)
?
If option 2 then I'd propose the settings as outlined in https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/137#issuecomment-418144756 where you would need to specify the <dotGitDirectory>.
We have only one .git directory, it is located at the root of the project:
+--- module1
| +--- pom.xml
+--- module2
| +--- pom.xml
....
+--- moduleN
| +--- pom.xml
+---- pom.xml (the parent pom, also contains <modules> section with list of our modules)
\--- `.git` (root git directory)
We would like to get the date and time of last change related to the corresponding module directory. Аfter the build, we should have N modules with N different timestmps.
Thanks for the detailed explanation and sorry for the delay. I will try to review the changes ASAP.