o merged r609576 (MNG-2925: NullPointerException in PluginDescriptor.getMojo() if there's no mojo in pom.xml)

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@609577 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Siveton 2008-01-07 11:46:27 +00:00
parent ff53010e7e
commit 4e41fbea47
1 changed files with 10 additions and 5 deletions

View File

@ -60,7 +60,7 @@ public class PluginDescriptor
private boolean inheritedByDefault = true;
private List artifacts;
private Map lifecycleMappings;
private ClassRealm classRealm;
@ -258,6 +258,11 @@ public class PluginDescriptor
public MojoDescriptor getMojo( String goal )
{
if ( getMojos() == null )
{
return null; // no mojo in this POM
}
// TODO: could we use a map? Maybe if the parent did that for components too, as this is too vulnerable to
// changes above not being propogated to the map
@ -329,22 +334,22 @@ public class PluginDescriptor
{
return introducedDependencyArtifacts != null ? introducedDependencyArtifacts : Collections.EMPTY_SET;
}
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
public void setDescription( String description )
{
this.description = description;
}
public String getDescription()
{
return description;