mirror of https://github.com/apache/maven.git
fix NPE when there is no goal configuration
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4ba9fbcc33
commit
886d787bf4
|
@ -683,14 +683,21 @@ public class DefaultPluginManager
|
|||
if ( index >= 0 )
|
||||
{
|
||||
String goalName = goalId.substring( index + 1 );
|
||||
for ( Iterator j = plugin.getGoals().iterator(); j.hasNext(); )
|
||||
for ( Iterator j = plugin.getGoals().iterator(); j.hasNext() && dom == null; )
|
||||
{
|
||||
Goal goal = (Goal) j.next();
|
||||
if ( goal.getId().equals( goalName ) )
|
||||
{
|
||||
Xpp3Dom goalConfiguration = (Xpp3Dom) goal.getConfiguration();
|
||||
dom = Xpp3DomUtils.mergeXpp3Dom( Xpp3DomUtils.copyXpp3Dom( goalConfiguration ), dom );
|
||||
break;
|
||||
if ( goalConfiguration != null )
|
||||
{
|
||||
dom =
|
||||
Xpp3DomUtils.mergeXpp3Dom( Xpp3DomUtils.copyXpp3Dom( goalConfiguration ), dom );
|
||||
}
|
||||
else
|
||||
{
|
||||
dom = new Xpp3Dom( "configuration" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue