Fix assertions in Arguments
This commit is contained in:
@@ -32,7 +32,6 @@ import releaser.internal.project.ProjectVersion;
|
||||
import releaser.internal.project.Projects;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Arguments for a task.
|
||||
@@ -83,11 +82,12 @@ public final class Arguments implements Serializable {
|
||||
|
||||
private Arguments(ProjectToRun thisProject, Projects projects,
|
||||
ProjectVersion currentProjectFromBom) {
|
||||
log.info("Creating Arguments for: " + thisProject.name() + "; Original version: " + thisProject.originalVersion);
|
||||
log.info("Creating Arguments for: " + thisProject.name() + "; Original version: "
|
||||
+ thisProject.originalVersion);
|
||||
this.project = thisProject.thisProjectFolder;
|
||||
this.projects = projects;
|
||||
this.originalVersion = thisProject.originalVersion;
|
||||
Assert.isTrue(!StringUtils.isEmpty(this.originalVersion),
|
||||
Assert.isTrue(this.originalVersion != null,
|
||||
"Original Version must not be empty for project: " + thisProject.name());
|
||||
this.versionFromBom = currentProjectFromBom;
|
||||
this.properties = thisProject.thisProjectReleaserProperties;
|
||||
@@ -101,12 +101,13 @@ public final class Arguments implements Serializable {
|
||||
// in this case the project will be the BOM
|
||||
private Arguments(ProjectToRun thisProject,
|
||||
List<ProcessedProject> processedProjects) {
|
||||
log.info("Creating Arguments for: " + thisProject.name() + "; Original version: " + thisProject.originalVersion);
|
||||
log.info("Creating Arguments for: " + thisProject.name() + "; Original version: "
|
||||
+ thisProject.originalVersion);
|
||||
this.project = thisProject.thisProjectFolder;
|
||||
this.projects = new Projects(processedProjects.stream()
|
||||
.map(p -> p.newProjectVersion).collect(Collectors.toSet()));
|
||||
this.originalVersion = thisProject.originalVersion;
|
||||
Assert.isTrue(!StringUtils.isEmpty(this.originalVersion),
|
||||
Assert.isTrue(this.originalVersion != null,
|
||||
"Original Version must not be empty for project: " + thisProject.name());
|
||||
this.versionFromBom = thisProject.thisProjectVersionFromBom;
|
||||
this.properties = thisProject.thisProjectReleaserProperties;
|
||||
|
||||
Reference in New Issue
Block a user