mirror of https://github.com/apache/maven.git
o Made plugin manager bail out if requested mojo can't be loaded to save clients from NPEs
git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@774885 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7ccc3d878e
commit
3e287c47bb
|
@ -493,13 +493,19 @@ public class DefaultPluginManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
|
public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, ArtifactRepository localRepository,
|
||||||
|
List<ArtifactRepository> remoteRepositories )
|
||||||
throws PluginLoaderException
|
throws PluginLoaderException
|
||||||
{
|
{
|
||||||
PluginDescriptor pluginDescriptor = loadPlugin( plugin, localRepository, remoteRepositories );
|
PluginDescriptor pluginDescriptor = loadPlugin( plugin, localRepository, remoteRepositories );
|
||||||
|
|
||||||
MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal );
|
MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal );
|
||||||
|
|
||||||
|
if ( mojoDescriptor == null )
|
||||||
|
{
|
||||||
|
throw new PluginLoaderException( plugin, "Failed to load plugin mojo. Reason: Unknown mojo: " + goal );
|
||||||
|
}
|
||||||
|
|
||||||
return mojoDescriptor;
|
return mojoDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue