You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to configure plugin execution so that maven sequence do not break? #392
Hi I am using git commit plugin to store details of commit in a properties file and then read this file to compute some logic. I am using jgit flow plugin to manage git cycles in my development process. When I feature finish my branch it does all the process but it throws exception as the plugin have changed the file which is not committed and hence breaks the process. I can not ignore the file as I need it inside some specific resources package.
Expected behavior
I want the plugin to update the file without breaking the process, as I will need updated commit details when feature finish or release finish.
Hi,
thanks for reporting your issue here.
Based on the context provided I don't quite understand what is not working (within the plugin) and especially what you expect differently. I don't quite understand yet how the plugin would fail based on the git workflow being used.
but it throws exception as the plugin have changed the file which is not committed and hence breaks the process.
What process throws what exception?
Is it the plugin or the jgit flow plugin?
Is there a (public) project where this issue can be reproduced?
Please include any stack-traces or any error messages and furthermore please provide a description of what you expected to happen.
The problem is not the plugin, but how can we skip it for some specific goals of maven execution ?
Problem is that when merging my branch to develop using jgitflow plugin , plugin even stores commit values for that operation, hence making the execution goal failure for feature finish.
Checkout Conflict Exception at the end of process. Sorry there is not any public project to reproduce the event.
how can we skip it for some specific goals of maven execution ?
That sounds like you need maven profiles, where different things happen based on a different context.
One way to achieve something like this with profiles (really basic example) could be achieved with leveraging the skip parameter of the plugin configuration and define a global property that is getting overwritten by the profile when it is activated (in the following case this would be runGitCommitIdPlugin).
I understand this example is somewhat not complete, but takes advantage that you use this plugin on a global level and have it disabled when a specific profile is activated. Once the profile is active it should overwrite the custom skip property and make the plugin skip the execution.
There are various ways on activate profiles (either by command line mvn clean package -P<profile-name> or by some sort of activation rules when a file is present).
Alternatively with version 2.2.3 you can also skip the plugin by using the command line option -Dmaven.gitcommitid.skip=true.
Activity
TheSnoozer commentedon Oct 22, 2018
Hi,
thanks for reporting your issue here.
Based on the context provided I don't quite understand what is not working (within the plugin) and especially what you expect differently. I don't quite understand yet how the plugin would fail based on the git workflow being used.
What process throws what exception?
Is it the plugin or the jgit flow plugin?
Is there a (public) project where this issue can be reproduced?
Please include any stack-traces or any error messages and furthermore please provide a description of what you expected to happen.
dishesh commentedon Oct 23, 2018
The problem is not the plugin, but how can we skip it for some specific goals of maven execution ?
Problem is that when merging my branch to develop using jgitflow plugin , plugin even stores commit values for that operation, hence making the execution goal failure for feature finish.
Checkout Conflict Exceptionat the end of process. Sorry there is not any public project to reproduce the event.TheSnoozer commentedon Oct 23, 2018
That sounds like you need maven profiles, where different things happen based on a different context.
One way to achieve something like this with profiles (really basic example) could be achieved with leveraging the
skipparameter of the plugin configuration and define a global property that is getting overwritten by the profile when it is activated (in the following case this would berunGitCommitIdPlugin).I understand this example is somewhat not complete, but takes advantage that you use this plugin on a global level and have it disabled when a specific profile is activated. Once the profile is active it should overwrite the custom skip property and make the plugin skip the execution.
There are various ways on activate profiles (either by command line
mvn clean package -P<profile-name>or by some sort of activation rules when a file is present).Alternatively with version 2.2.3 you can also skip the plugin by using the command line option
-Dmaven.gitcommitid.skip=true.See https://maven.apache.org/guides/introduction/introduction-to-profiles.html for further information on profiles.
TheSnoozer commentedon Nov 1, 2018
I would assume you solved the issue by now.
Feel free to reopen the issue if you have further questions about 'how to exclude the plugin'
Small changes in docs (#512)
Small changes in docs (apache#512)