Skip to content

Commit

Permalink
Merge pull request #73 from towerworks/develop
Browse files Browse the repository at this point in the history
issue #72: honour return value of provider.tag()
  • Loading branch information
bvarner authored May 18, 2017
2 parents 3207f62 + 4356bba commit 988823c
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTagParameters;
import org.apache.maven.scm.command.tag.TagScmResult;
import org.apache.maven.scm.provider.ScmProvider;
import org.apache.maven.scm.repository.ScmRepository;

Expand Down Expand Up @@ -51,7 +52,15 @@ protected void execute(final GitBranchType type, final String gitBranch, final S
ScmTagParameters tagParams = new ScmTagParameters("Release tag [" + sanitizedTag + "] generated by gitflow-helper-maven-plugin.");
tagParams.setRemoteTagging(true);

provider.tag(repository, new ScmFileSet(project.getBasedir()), sanitizedTag, tagParams);
final TagScmResult tagScmResult = provider.tag(repository, new ScmFileSet(project.getBasedir()), sanitizedTag, tagParams);
if (!tagScmResult.isSuccess()) {
getLog().error("Provider message:");
getLog().error(tagScmResult.getProviderMessage());
getLog().error("Command output:");
getLog().error(tagScmResult.getCommandOutput());

throw new MojoFailureException(tagScmResult.getProviderMessage() );
}
} catch (ScmException scme) {
throw new MojoFailureException("Unable to tag master branch.", scme);
}
Expand Down

0 comments on commit 988823c

Please sign in to comment.