Skip to content

Commit

Permalink
licenseName is required (#607)
Browse files Browse the repository at this point in the history
* licenseName is required
* Remove an unnecessary check
  • Loading branch information
vitalijr2 authored Nov 16, 2024
1 parent 75c0db6 commit 602b393
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public abstract class AbstractLicenseNameMojo extends AbstractLicenseMojo {
* @parameter property="license.licenseName"
* @since 1.0
*/
@Parameter(property = "license.licenseName")
@Parameter(property = "license.licenseName", required = true)
private String licenseName;

/**
Expand Down Expand Up @@ -227,9 +227,6 @@ protected void init() throws Exception {
// ----------------------------------------------------------------------

protected License getLicense(String licenseName, boolean checkIfExists) {
if (StringUtils.isEmpty(licenseName)) {
throw new IllegalArgumentException("licenseName can not be null, nor empty");
}
if (licenseStore == null) {
throw new IllegalStateException("No license store initialized!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ public License[] getLicenses() {

public License getLicense(String licenseName) {
checkInit("getLicense");
if (StringUtils.isEmpty(licenseName)) {
throw new IllegalArgumentException("licenceName can not be null, nor empty");
}

License license = null;
for (License l : this) {
Expand Down

0 comments on commit 602b393

Please sign in to comment.