mirror of
https://github.com/apache/maven.git
synced 2025-02-06 18:18:48 +00:00
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 @@ private void populatePluginFields( Mojo mojo, MojoDescriptor mojoDescriptor, Cla
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
PluginDescriptor pluginDescriptor = loadPlugin( plugin, localRepository, remoteRepositories );
|
||||
|
||||
MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal );
|
||||
|
||||
if ( mojoDescriptor == null )
|
||||
{
|
||||
throw new PluginLoaderException( plugin, "Failed to load plugin mojo. Reason: Unknown mojo: " + goal );
|
||||
}
|
||||
|
||||
return mojoDescriptor;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user