diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateHpiMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateHpiMojo.java index b593db32f4..a0dbc84d87 100644 --- a/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateHpiMojo.java +++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateHpiMojo.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.util.jar.Attributes; import java.util.jar.JarFile; +import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -41,8 +42,14 @@ public void execute() throws MojoExecutionException, MojoFailureException { } } if (coreVersion.compareTo(maxCoreVersion) < 0) { - throw new MojoExecutionException( - "Dependency " + maxCoreVersionArtifact + " requires Jenkins " + maxCoreVersion + " or higher."); + String error = + "Dependency " + maxCoreVersionArtifact + " requires Jenkins " + maxCoreVersion + " or higher."; + if (ArtifactUtils.isSnapshot(coreVersion.toString()) + || ArtifactUtils.isSnapshot(maxCoreVersion.toString())) { + getLog().warn(error); + } else { + throw new MojoExecutionException(error); + } } }