From 00bbe48e562fffe1264fb708dc9878f839ee9a45 Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Mon, 6 Dec 2010 09:10:29 +0100 Subject: Refactoring. --- .../src/main/java/org/semver/enforcer/AbstractEnforcerRule.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/enforcer-rule/src/main/java/org/semver/enforcer/AbstractEnforcerRule.java b/enforcer-rule/src/main/java/org/semver/enforcer/AbstractEnforcerRule.java index 0fd0b36..5346e18 100644 --- a/enforcer-rule/src/main/java/org/semver/enforcer/AbstractEnforcerRule.java +++ b/enforcer-rule/src/main/java/org/semver/enforcer/AbstractEnforcerRule.java @@ -53,6 +53,7 @@ import org.semver.Version; public abstract class AbstractEnforcerRule implements EnforcerRule { private static final String SNAPSHOT_VERSION_SUFFIX = "-SNAPSHOT"; + private static final String JAR_ARTIFACT_TYPE = "jar"; /** * Version number of artifact to be checked. @@ -98,8 +99,8 @@ public abstract class AbstractEnforcerRule implements EnforcerRule { throw new EnforcerRuleException("Failed to access ${project} variable", e); } final String type = project.getArtifact().getType(); - if (!"jar".equals(type)) { - throw new IllegalArgumentException("Only support 'jar' as artifact type"); + if (!JAR_ARTIFACT_TYPE.equals(type)) { + throw new IllegalArgumentException("Only support '"+JAR_ARTIFACT_TYPE+"' as artifact type"); } final Artifact previousArtifact; -- cgit v1.2.3