From 4fe9fb7bf0c8aedacc27e252e0e92fe8ca48c5ba Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 27 Nov 2017 15:30:50 +0100 Subject: [PATCH] #66 - Polishing. Introduced Iteration.isPreview() to allow finding out whether the current iteration produces either a milestone or release candidate. --- .../data/release/build/MavenBuildSystem.java | 4 ++-- .../springframework/data/release/model/Iteration.java | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/release-tools/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java b/release-tools/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java index e7019f7..5c0fbb3 100644 --- a/release-tools/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java +++ b/release-tools/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java @@ -309,8 +309,8 @@ class MavenBuildSystem implements BuildSystem { Assert.notNull(module, "Module iteration must not be null!"); Assert.notNull(information, "Deployment information must not be null!"); - if (module.getIteration().isPublic()) { - logger.log(module, "Not a public version, skipping Artifactory deployment."); + if (!module.getIteration().isPreview()) { + logger.log(module, "Not a preview version (milestone or release candidate). Skipping Artifactory deployment."); return; } diff --git a/release-tools/src/main/java/org/springframework/data/release/model/Iteration.java b/release-tools/src/main/java/org/springframework/data/release/model/Iteration.java index 4b0dc8e..496d3cf 100644 --- a/release-tools/src/main/java/org/springframework/data/release/model/Iteration.java +++ b/release-tools/src/main/java/org/springframework/data/release/model/Iteration.java @@ -72,6 +72,15 @@ public class Iteration { return isServiceIteration() || this.equals(GA); } + /** + * Returns whether the current Iteration is going to produce a preview release, i.e. a milestone or release candidate. + * + * @return + */ + public boolean isPreview() { + return !isPublic(); + } + public boolean isServiceIteration() { return name.startsWith("SR"); }