try
{
branchType = branchHelper.getCurrentBranchType();
ReleaseContext ctx = contextProvider.getContext();
JGitFlow flow = jGitFlowProvider.gitFlow();
switch (branchType)
{
case RELEASE:
cacheKey = ProjectCacheKey.RELEASE_FINISH_LABEL;
versionSuffix = ctx.getReleaseBranchVersionSuffix();
break;
case HOTFIX:
cacheKey = ProjectCacheKey.HOTFIX_LABEL;
versionSuffix = "";
break;
default:
throw new JGitFlowExtensionException("Unsupported branch type '" + branchType.name() + "' while running " + this.getClass().getSimpleName() + " command");
}
checkNotNull(cacheKey);
String fullBranchName = branchHelper.getCurrentBranchName();
getLogger().info("(" + fullBranchName + ") Updating poms for " + branchType.name());
//reload the reactor projects for release
List<MavenProject> branchProjects = branchHelper.getProjectsForCurrentBranch();
pomUpdater.removeSnapshotFromPomVersions(cacheKey, versionSuffix, branchProjects);
projectHelper.commitAllPoms(flow.git(), branchProjects, ctx.getScmCommentPrefix() + "updating poms for branch'" + fullBranchName + "' with non-snapshot versions" + ctx.getScmCommentSuffix());
}
catch (Exception e)
{
throw new JGitFlowExtensionException("Error updating poms with non-snapshot versions for branch '" + branchType.name() + "'");
}