How to get Sourcetree gitflow action to update version in pom.xml

I am trying to get my head around use of git flow inside Sourcetree. However, I'm struggling with the way it deals with (or rather, _doesn't_ deal with) versions in maven pom.xml files.

For some reason, when I use "start a release" from the Sourcetree Git Flow menu, it does not update the version set in the project pom, but just creates a new release branch. In contrast, when i execute `mvn jgitflow:release-start` from the commandline, it does update the pom as I expect it to, so as far as I can tell my project is set up correctly.

What am I overlooking/is there some way to correct this behavior?

This is sourcetree 1.8.1 on Mac OS X 10.9.1, using embedded git-flow by the way.

1 answer

1 accepted

Accepted Answer
2 votes

In the command you list, it is important to note that maven is not integrated with git. Rather, git has been integrated into maven. SourceTree is a Git client, not a maven client, so when you do gitflow in sourcetree, it is the same as running "git flow release start" at the command line. Your "mvn" command (maven) is a maven command that also runs a git flow command.

Additionally, nvie's gitflow (the one used by SourceTree) does not support hooks, so I can't see any way to emulate mvn's behavior in SourceTree's gitflow. I don't know if you can get sourcetree to use petervanderdoes fork, but if you can, you can make a hook on release start to update pom.xml. You can also join the chorus of people asking SourceTree to switch their embedded gitflow plugin to petervanderdoes, but who knows if/when that'll happen.

You might consider creating a set of Custom Actions that run the mvn jgitflow commands instead of using SourceTree's Gitflow UI, but you'd lose the recognition of your current gitflow state that the UI provides.

If you want to request SourceTree to use the petervanderdoes (AVH) fork, do so at JIRA.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 5 hours ago in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

48 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you