aboutsummaryrefslogtreecommitdiffstats
path: root/enforcer-rule/src
diff options
context:
space:
mode:
authorJulien Eluard <[email protected]>2010-11-16 12:38:32 +0100
committerJulien Eluard <[email protected]>2010-11-16 12:38:32 +0100
commitd88dfa22db5fe11c69b2749b0bcc02930ae67e3f (patch)
tree14a6f7f7a6241d7de99d59a06397fa8289e27354 /enforcer-rule/src
parent1410b3327dea069e5b4f843604a946789132e114 (diff)
Improved error handling.
Diffstat (limited to 'enforcer-rule/src')
-rw-r--r--enforcer-rule/src/main/java/org/semver/enforcer/CheckVersionRule.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/enforcer-rule/src/main/java/org/semver/enforcer/CheckVersionRule.java b/enforcer-rule/src/main/java/org/semver/enforcer/CheckVersionRule.java
index f167dfe..d1c1283 100644
--- a/enforcer-rule/src/main/java/org/semver/enforcer/CheckVersionRule.java
+++ b/enforcer-rule/src/main/java/org/semver/enforcer/CheckVersionRule.java
@@ -33,6 +33,7 @@ import org.apache.maven.enforcer.rule.api.EnforcerRule;
import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.StringUtils;
import org.semver.Checker;
import org.semver.Version;
@@ -75,6 +76,9 @@ public final class CheckVersionRule implements EnforcerRule {
@Override
public void execute(final EnforcerRuleHelper helper) throws EnforcerRuleException {
+ if (StringUtils.isEmpty(this.previousVersion)) {
+ throw new EnforcerRuleException("previousVersion can't be empty");
+ }
final Artifact previousArtifact;
final Artifact currentArtifact;
try {