diff --git a/CHANGELOG.md b/CHANGELOG.md index e8e955c..725514c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ ## Unreleased ### No issue +**Doc** + + +[fb50ecdd8867308](https://github.com/tomasbjerre/violation-comments-to-gitlab-maven-plugin/commit/fb50ecdd8867308) Tomas Bjerre *2017-12-22 20:05:59* + + +## violation-comments-to-gitlab-maven-plugin-1.8 +### No issue + **Bumping version to fix faulty release** diff --git a/src/main/java/se/bjurr/violations/comments/github/maven/ViolationCommentsMojo.java b/src/main/java/se/bjurr/violations/comments/github/maven/ViolationCommentsMojo.java index 3eba739..a201884 100644 --- a/src/main/java/se/bjurr/violations/comments/github/maven/ViolationCommentsMojo.java +++ b/src/main/java/se/bjurr/violations/comments/github/maven/ViolationCommentsMojo.java @@ -7,7 +7,6 @@ import static org.gitlab.api.TokenType.PRIVATE_TOKEN; import static se.bjurr.violations.comments.gitlab.lib.ViolationCommentsToGitLabApi.violationCommentsToGitLabApi; import static se.bjurr.violations.lib.ViolationsReporterApi.violationsReporterApi; -import static se.bjurr.violations.lib.model.SEVERITY.INFO; import java.util.ArrayList; import java.util.List; @@ -27,13 +26,17 @@ public class ViolationCommentsMojo extends AbstractMojo { @Parameter(property = "violations", required = false) - private final List violations = new ArrayList(); + private List violations; - @Parameter(property = "commentOnlyChangedContent", required = false) - private final boolean commentOnlyChangedContent = true; + @Parameter(property = "commentOnlyChangedContent", required = false, defaultValue = "true") + private boolean commentOnlyChangedContent; - @Parameter(property = "createCommentWithAllSingleFileComments", required = false) - private final boolean createCommentWithAllSingleFileComments = true; + @Parameter( + property = "createCommentWithAllSingleFileComments", + required = false, + defaultValue = "true" + ) + private boolean createCommentWithAllSingleFileComments; @Parameter(property = "gitLabUrl", required = false) private String gitLabUrl; @@ -47,23 +50,23 @@ public class ViolationCommentsMojo extends AbstractMojo { @Parameter(property = "mergeRequestId", required = false) private String mergeRequestId; - @Parameter(property = "ignoreCertificateErrors", required = false) - private final Boolean ignoreCertificateErrors = true; + @Parameter(property = "ignoreCertificateErrors", required = false, defaultValue = "true") + private Boolean ignoreCertificateErrors; - @Parameter(property = "apiTokenPrivate", required = false) - private final Boolean apiTokenPrivate = true; + @Parameter(property = "apiTokenPrivate", required = false, defaultValue = "true") + private Boolean apiTokenPrivate; - @Parameter(property = "authMethodHeader", required = false) - private final Boolean authMethodHeader = true; + @Parameter(property = "authMethodHeader", required = false, defaultValue = "true") + private Boolean authMethodHeader; - @Parameter(property = "minSeverity", required = false) - private final SEVERITY minSeverity = INFO; + @Parameter(property = "minSeverity", required = false, defaultValue = "INFO") + private SEVERITY minSeverity; @Parameter(property = "keepOldComments", required = false) - private final Boolean keepOldComments = false; + private Boolean keepOldComments; @Parameter(property = "shouldSetWip", required = false) - private final Boolean shouldSetWip = false; + private Boolean shouldSetWip; @Override public void execute() throws MojoExecutionException { @@ -72,6 +75,11 @@ public void execute() throws MojoExecutionException { return; } + if (violations == null || violations.isEmpty()) { + getLog().info("No violations configured."); + return; + } + getLog() .info( "Will comment project " + projectId + " and MR " + mergeRequestId + " on " + gitLabUrl);