o Fixed NPE

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@792721 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-09 21:47:54 +00:00
parent 52519425f7
commit d56f9e13bb
2 changed files with 11 additions and 1 deletions

View File

@ -717,7 +717,7 @@ public class DefaultLifecycleExecutor
} }
else else
{ {
throw new PluginNotFoundException( plugin, null ); throw new PluginNotFoundException( plugin, remoteRepositories );
} }
} }

View File

@ -19,6 +19,9 @@ package org.apache.maven.plugin;
* under the License. * 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.AbstractArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.model.Plugin; import org.apache.maven.model.Plugin;
@ -41,6 +44,13 @@ public class PluginNotFoundException
this.plugin = plugin; this.plugin = plugin;
} }
public PluginNotFoundException( Plugin plugin, List<ArtifactRepository> 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() public Plugin getPlugin()
{ {
return plugin; return plugin;