{
String projectVersion = rootProject.getVersion();
String defaultVersion = projectVersion;
HotfixVersionInfo hotfixInfo = null;
if (StringUtils.isNotBlank(lastRelease) && !ArtifactUtils.isSnapshot(lastRelease))
{
try
{
DefaultVersionInfo projectInfo = new DefaultVersionInfo(projectVersion);
DefaultVersionInfo lastReleaseInfo = new DefaultVersionInfo(lastRelease);
String higherVersion = projectVersion;
if (projectInfo.isSnapshot())
{
higherVersion = lastRelease;
}
else if (projectInfo.compareTo(lastReleaseInfo) < 1)
{
higherVersion = lastRelease;
}
hotfixInfo = new HotfixVersionInfo(higherVersion);
defaultVersion = hotfixInfo.getHotfixVersionString();
}
catch (VersionParseException e)
{
//just ignore
}
}
else
{
try
{
hotfixInfo = new HotfixVersionInfo(projectVersion);
defaultVersion = hotfixInfo.getHotfixVersionString();
}
catch (VersionParseException e)
{
//ignore
}
}
String suggestedVersion = defaultVersion;
String hotfixVersion = null;
while (null == suggestedVersion || ArtifactUtils.isSnapshot(suggestedVersion))
{
HotfixVersionInfo info = null;
try
{
info = new HotfixVersionInfo(rootProject.getVersion());
}
catch (VersionParseException e)
{
if (ctx.isInteractive())
{
try
{
info = new HotfixVersionInfo("2.0");
}
catch (VersionParseException e1)
{
throw new JGitFlowReleaseException("error parsing 2.0 version!!!", e1);
}
}
else
{
throw new JGitFlowReleaseException("error parsing release version: " + e.getMessage(), e);
}
}
suggestedVersion = info.getDecrementedHotfixVersionString();
}
while (null == hotfixVersion || ArtifactUtils.isSnapshot(hotfixVersion))
{
if (ctx.isInteractive())