From d56f9e13bb50ead6388bb8f3061cbbefb179a22b Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Thu, 9 Jul 2009 21:47:54 +0000 Subject: [PATCH] o Fixed NPE git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@792721 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/lifecycle/DefaultLifecycleExecutor.java | 2 +- .../apache/maven/plugin/PluginNotFoundException.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java index ea8d3df2c4..0dc998e57b 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -717,7 +717,7 @@ public class DefaultLifecycleExecutor } else { - throw new PluginNotFoundException( plugin, null ); + throw new PluginNotFoundException( plugin, remoteRepositories ); } } diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginNotFoundException.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginNotFoundException.java index 1dec562276..3763e7d9ab 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/PluginNotFoundException.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginNotFoundException.java @@ -19,6 +19,9 @@ package org.apache.maven.plugin; * under the License. */ +import java.util.List; + +import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.model.Plugin; @@ -41,6 +44,13 @@ public class PluginNotFoundException this.plugin = plugin; } + public PluginNotFoundException( Plugin plugin, List remoteRepositories ) + { + super( "Plugin could not be found, please check its coordinates for typos", plugin.getGroupId(), + plugin.getArtifactId(), plugin.getVersion(), "maven-plugin", null, remoteRepositories, null ); + this.plugin = plugin; + } + public Plugin getPlugin() { return plugin;