Search code examples
javamavenmaven-3jirajgitflow-maven-plugin

mvn jgitflow -- Push fails when no JIRA number available in jgitflow commits


We have placed hook on Stash to have JIRA number at start of commit message.

But when we use jgitflow, it does not put any JIRA number in commits, hence later pushing to Stash fails.

Question: How can we pass JIRA number to jgitflow while releasing to avoid this problem?


Solution

  • The release-start goal provides the scmCommentPrefix property for such a purpose:

    The message prefix to use for all SCM changes. Will be appended as is. e.g. getScmMessagePrefix() + the_message;

    You could hence invoke it as:

    mvn jgitflow:release-start -DscmCommentPrefix=JIRA-123
    

    The same is also provided for the release-finish goal via the same property, scmCommentPrefix.

    mvn jgitflow:release-finish -DscmCommentPrefix=JIRA-123
    

    It's an optional property in both cases, so no need to provide it if not required, but very useful in similar cases (hooks) indeed.