diff --git a/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java b/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java index 1786ec3a43630a7423ca39575bb070f40a583d3d..330e27383e2d9e793f53e4bda22c524458044b1c 100644 --- a/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java +++ b/test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java @@ -206,6 +206,7 @@ import java.util.logging.LogRecord; import java.util.logging.Logger; import jenkins.model.JenkinsLocationConfiguration; import org.acegisecurity.GrantedAuthorityImpl; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import static org.hamcrest.Matchers.hasXPath; import static org.hamcrest.Matchers.is; @@ -1623,6 +1624,9 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction { throws MavenEmbedderException, ComponentLookupException, AbstractArtifactResolutionException { final Artifact jpi = embedder.createArtifact(groupId, artifactId, version, "compile"/*doesn't matter*/, type); embedder.resolve(jpi, Arrays.asList(embedder.createRepository("http://maven.glassfish.org/content/groups/public/","repo")),embedder.getLocalRepository()); + if (jpi.getFile() == null) { + throw new ArtifactNotFoundException("cannot find plugin dependency", jpi); + } return jpi.getFile(); }