Skip to content

Commit 806cac1

Browse files
committed
fix: set default value on option when it's not use
1 parent ebd8427 commit 806cac1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/main/java/io/github/zorin95670/semver/GenerateChangelogMojo.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ public class GenerateChangelogMojo extends AbstractMojo {
2626
private File basedir;
2727

2828
public void execute() throws MojoExecutionException {
29+
if (scope == null) {
30+
scope = "";
31+
}
32+
if (tagPrefix == null) {
33+
tagPrefix = "v";
34+
}
2935
getLog().info("Generate Changelog plugin started");
3036
GitService gitService = new GitService(basedir);
3137
ChangelogService changelogService = new ChangelogService(basedir);

src/main/java/io/github/zorin95670/semver/ReleaseMojo.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ReleaseMojo extends AbstractMojo {
1919
@Parameter(property = "tagPrefix", defaultValue = "v")
2020
private String tagPrefix;
2121

22-
@Parameter(property = "scope")
22+
@Parameter(property = "scope", defaultValue = "")
2323
private String scope;
2424

2525
@Parameter(defaultValue = "${project}", readonly = true)
@@ -29,6 +29,12 @@ public class ReleaseMojo extends AbstractMojo {
2929
private File basedir;
3030

3131
public void execute() throws MojoExecutionException {
32+
if (scope == null) {
33+
scope = "";
34+
}
35+
if (tagPrefix == null) {
36+
tagPrefix = "v";
37+
}
3238
MavenService mavenService = new MavenService(project);
3339
GitService gitService = new GitService(basedir);
3440
ChangelogService changelogService = new ChangelogService(basedir);

0 commit comments

Comments
 (0)