{
String unprefixedBranchName = "";
try
{
ReleaseContext ctx = contextProvider.getContext();
if(!ctx.isEnableFeatureVersions())
{
return;
}
JGitFlow flow = jGitFlowProvider.gitFlow();
unprefixedBranchName = branchHelper.getUnprefixedCurrentBranchName();
//reload the reactor projects for release
List<MavenProject> branchProjects = branchHelper.getProjectsForCurrentBranch();
String featureVersion = NamingUtil.camelCaseOrSpaceToDashed(unprefixedBranchName);
featureVersion = StringUtils.replace(featureVersion, "-", "_");
pomUpdater.removeFeatureVersionFromSnapshotVersions(ProjectCacheKey.FEATURE_FINISH_LABEL, featureVersion, branchProjects);
projectHelper.commitAllPoms(flow.git(), branchProjects, ctx.getScmCommentPrefix() + "updating poms for " + featureVersion + " version" + ctx.getScmCommentSuffix());
}
catch (Exception e)
{
throw new JGitFlowExtensionException("Error updating poms with feature versions for branch '" + unprefixedBranchName + "'");