Verify that plugin has version as precondition in PluginManager.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@769560 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2009-04-28 21:52:43 +00:00
parent d2bbf510f9
commit c0d28d2ce4
1 changed files with 6 additions and 0 deletions

View File

@ -47,6 +47,7 @@ import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.execution.RuntimeInformation;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
@ -1024,6 +1025,11 @@ public class DefaultPluginManager
public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, MavenSession session )
throws PluginLoaderException
{
if ( plugin.getVersion() == null )
{
throw new IllegalArgumentException("plugin.version: null");
}
PluginDescriptor pluginDescriptor = loadPlugin( plugin, session.getCurrentProject(), session );
MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal );