I have enabled my BitBucket repo with a Pre Hook that will ensure that each commit message is associated with valid Jira issue. This setting is working as expected if manually some one is committing.
But this is not allowing Maven Release Plugin to push commits from jenkins, as a result of that, the pipeline is failing with error message
“One or more JIRA issues from your commits not found by query (project = xxxx)”
I am using maven-release-plugin 3.0.0-M4 with mvn release:prepare.
I am using following
If the Pre Hook is disabled in BitBucket, then Maven Release Plugin is able to do commits, and I can see all the commits are actually associated with the specified Jira issue.
Every time i am passing a valid Jira issue in place of xxxx-####
Please help me.
As I understand the scenario. You added an integration that makes sure all commits have a jira id and you are asking how to make jenkins not fail to commit.
I would say 1) Tell your integration to ignore jenkins user. 2) Make your jenkins add an jira id to your commit message.
I would say 1 should be pretty easy and straight forward
2, you could have a generic jira in your message. Otherwise you’d have to writing “smart” groovy to try and guess which jira to use based on previous commits.
In general when asking for help, its recommended to go “This is what i tried. I got X error” rather than “Solve this problem for me”
Thanks for the reply
I am very sorry for not providing the required details of the problem in my last post.
Following is the code in jenkins file
sh "mvn --batch-mode release:clean release:prepare release:perform release:branch -DscmCommentPrefix=‘xxxx-####’ -DscmDevelopmentCommitComment=‘xxxx-####’ -DscmReleaseCommitComment=‘xxxx-####’ -DscmBranchCommitComment=‘xxxx-####’ …
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M4:prepare (default-cli) on project test_project: unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed
[ERROR] Command output:
[ERROR] remote: "One or more JIRA issues from your commits not found by query (project = xxxx)”
If the PreHook is disabled in BitBucket then the commit is taking place with the supplied JIRA key.