e-gineering / gitflow-helper-maven-plugin

An extension and plugin that teaches Maven to work well with gitflow projects and CI servers.
Apache License 2.0
76 stars 21 forks source link

tag-master ignores git tag errors #72

Closed schmid-hanspeter closed 7 years ago

schmid-hanspeter commented 7 years ago

In TagMasterMojo the return value of the call to provider.tag(..) is ignored. The following fix takes this return value into account and produces an error log and exception exactly like maven's scm plugin would:

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());
}

I have had tag-master silently fail on me because of, for example, a duplicate tag.

bvarner commented 7 years ago

Care to send this as a PR? :-)

schmid-hanspeter commented 7 years ago

PR sent :-)

bvarner commented 7 years ago

Thanks for the submission! It's merged to development.