Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to obtain properties from a user specified directory #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nekrasov-iv
Copy link

@nekrasov-iv nekrasov-iv commented Dec 3, 2020

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 #136

…mber based of the last git commit in the module itself, and not based on the last git commit of the whole git project.
@TheSnoozer
Copy link
Collaborator

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 #137 (comment)). 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).

@nekrasov-iv
Copy link
Author

nekrasov-iv commented Dec 16, 2020

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?

@TheSnoozer
Copy link
Collaborator

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 #137 (comment) where you would need to specify the <dotGitDirectory>.

@nekrasov-iv
Copy link
Author

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.

@TheSnoozer
Copy link
Collaborator

Thanks for the detailed explanation and sorry for the delay. I will try to review the changes ASAP.

@TheSnoozer TheSnoozer added this to the 5.0.0 milestone Jun 10, 2021
TheSnoozer pushed a commit to git-commit-id/git-commit-id-maven-debugging that referenced this pull request Jun 12, 2021
…generate for all git-directories for a reactor-project
@TheSnoozer TheSnoozer removed this from the 5.0.0 milestone Jun 12, 2021
@TheSnoozer TheSnoozer changed the title Add option for multi module projects to get version number / build nu… Add an option to obtain properties from a user specified directory Jun 13, 2021
@TheSnoozer TheSnoozer added this to the 5.0.1 milestone Jul 5, 2021
@TheSnoozer TheSnoozer modified the milestones: 6.0.0, 7.0.0 May 16, 2023
@TheSnoozer TheSnoozer modified the milestones: 7.0.0, 7.0.1 Oct 21, 2023
@TheSnoozer TheSnoozer removed this from the 7.0.1 milestone Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants