[MNG-2293] maven-plugin-descriptor: Not possible to define a default implementation for a field defined by its interface

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@785804 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-06-17 21:09:59 +00:00
parent 962b2e233c
commit fc9b20303c
1 changed files with 18 additions and 18 deletions

View File

@ -499,7 +499,7 @@ public class DefaultLifecycleExecutor
{ {
Xpp3Dom mojoConfiguration = new Xpp3Dom( executionConfiguration.getName() ); Xpp3Dom mojoConfiguration = new Xpp3Dom( executionConfiguration.getName() );
Collection<String> mojoParameters = mojoDescriptor.getParameterMap().keySet(); Map<String, Parameter> mojoParameters = mojoDescriptor.getParameterMap();
Map<String, String> aliases = new HashMap<String, String>(); Map<String, String> aliases = new HashMap<String, String>();
if ( mojoDescriptor.getParameters() != null ) if ( mojoDescriptor.getParameters() != null )
@ -519,29 +519,29 @@ public class DefaultLifecycleExecutor
Xpp3Dom executionDom = executionConfiguration.getChild( i ); Xpp3Dom executionDom = executionConfiguration.getChild( i );
String paramName = executionDom.getName(); String paramName = executionDom.getName();
if ( mojoParameters.contains( paramName ) ) Xpp3Dom mojoDom;
if ( mojoParameters.containsKey( paramName ) )
{ {
Xpp3Dom mojoDom = new Xpp3Dom( executionDom ); mojoDom = new Xpp3Dom( executionDom );
mojoConfiguration.addChild( mojoDom );
} }
else if ( aliases.containsKey( paramName ) ) else if ( aliases.containsKey( paramName ) )
{ {
Xpp3Dom mojoDom = new Xpp3Dom( aliases.get( paramName ) ); mojoDom = new Xpp3Dom( executionDom, aliases.get( paramName ) );
mojoDom.setValue( executionDom.getValue() ); }
else
for ( String attributeName : executionDom.getAttributeNames() )
{ {
mojoDom.setAttribute( attributeName, executionDom.getAttribute( attributeName ) ); continue;
} }
for ( Xpp3Dom child : executionDom.getChildren() ) String implementation = mojoParameters.get( mojoDom.getName() ).getImplementation();
if ( StringUtils.isNotEmpty( implementation ) )
{ {
mojoDom.addChild( new Xpp3Dom( child ) ); mojoDom.setAttribute( "implementation", implementation );
} }
mojoConfiguration.addChild( mojoDom ); mojoConfiguration.addChild( mojoDom );
} }
}
return mojoConfiguration; return mojoConfiguration;
} }