Adding assertion for original version not being null

This commit is contained in:
Oleg Zhurakousky
2022-01-27 11:47:21 +01:00
parent 1c06770975
commit ea70e08b73

View File

@@ -23,9 +23,15 @@ import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import releaser.internal.ReleaserProperties;
import releaser.internal.options.Options;
import releaser.internal.project.ProcessedProject;
import releaser.internal.project.ProjectCommandExecutor;
import releaser.internal.project.ProjectVersion;
import releaser.internal.project.Projects;
@@ -34,6 +40,9 @@ import releaser.internal.project.Projects;
*/
public final class Arguments implements Serializable {
private static final Logger log = LoggerFactory
.getLogger(Arguments.class);
/**
* Cloned location of the project.
*/
@@ -76,9 +85,11 @@ public final class Arguments implements Serializable {
private Arguments(ProjectToRun thisProject, Projects projects,
ProjectVersion currentProjectFromBom) {
this.project = thisProject.thisProjectFolder;
this.projects = projects;
this.originalVersion = thisProject.originalVersion;
Assert.isTrue(!StringUtils.isEmpty(this.originalVersion), "Original Version must not be empty for project: " + thisProject.name());
this.versionFromBom = currentProjectFromBom;
this.properties = thisProject.thisProjectReleaserProperties;
this.options = thisProject.options;