Closed
Description
Hi,
Firstly, I'd to congratulate you all for this great plugin. This is very useful!
Second, I'd like to ask if already exists or suggest an option to configure the plugin to read multiple Git folder information.
For instance in my current case, I have a git repo that tracks the J2EE content and another git repo that tracks just the front-end code (HTML, CSS, Js, etc):
- <project_root>/.git
- <project_root>/src/main/webapp/.git
And, it'd be great if I could track the latest version of the built package of both gits.
Maybe, setting two configuration sets with two different prefix:
...
<configuration>
<prefix>git1</prefix>
...
</configuration>
<configuration>
<prefix>git2</prefix>
...
</configuration>
And, instead of only one git.properties, we could have:
# git1.properties
git.commit.id.describe=${git1.commit.id.describe}
...
# git2.properties
git.commit.id.describe=${git2.commit.id.describe}
I understand that this is not very common, but I believe it'd be nice to have this plugin the most flexible as possible.
Thanks
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
ktoso commentedon Dec 13, 2014
That might be rather weird to implement... I won't be implementing this any time soon, though I understand your use case.
I would be perfectly happy to review and pull in a pull request though :-) hint, hint 😉
TheSnoozer commentedon Sep 3, 2018
Even though this issue is here for ages and the original reporter probability doesn't need it anymore....out of curiosity I tested that and this is somewhat already supported by maven to run the plugin with different configurations. Simply specify each
run
asexecution
.Full example:
Now you could use this to either generate two (or multiple) property files, or simply use maven filtering and populate the generated properties into an aggregated property file:
Personal remarks / Note
Intuitively I would assume that in the above example the
configuration
inside theexecution
would inherit from theconfiguration
defined on the global plugin level. Knowing maven I would strongly advice to test this carefully with all maven versions you want to support with this configuration. This might not be working as you want in all circumstances (worked fine for some maven versions I just tested). In case you run into issues, I would advice to duplicate the pluginconfiguration
into eachconfiguration
inside theexecution
and remove the pluginconfiguration
entirely (so each execution has its own configuration and the inheritance question doesn't even pop up).See also
https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_executions_Tag
for further information (e.g. since Maven 3.3.1 you could also invoke the executions via CLI
mvn git-commit-id-plugin:revision@get-the-git-infos-for-repository-one
)Since this is somewhat a border case and already somewhat supported (by just running the plugin multiple times) I'll go ahead and close this issue.
Feel free to reopen if you have further questions.
git-commit-id#411 (comment) / git-commit-id#137: ensure that the new …
susannamichael54 commentedon Nov 5, 2020
Hi, I was trying to generate the properties file for a submodule along with the parent module. I am using version 4.0.0 of the plugin. The solution of using two executions, as shown above, does not work in my case because the configuration tag is not valid within the execution tag for the version. Could you suggest an alternative?
TheSnoozer commentedon Nov 7, 2020
Hello, what do you mean by
configuration tag is not valid within the execution tag for the version
- i don't understand :-)As a side note: please create a new issue for your problem.
susannamichael54 commentedon Nov 10, 2020
Hi, I am really sorry about that. I got something wrong. Sorry for the inconvenience.