MNG-3979.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@736252 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2009-01-21 07:35:33 +00:00
parent 01f81a5d11
commit 68d8ce9d34
2 changed files with 29 additions and 10 deletions

View File

@ -380,12 +380,31 @@ public class PomTransformer
listener.fire(ds.queryFor(uri));
}
}
// for(ModelProperty mp : props) {
// if(mp.getUri().startsWith(ProjectUri.Build.Plugins.Plugin.Executions.Execution.configuration)) {
// System.out.println(mp);
// }
// }
return factory.createDomainModel( props );
//Cleanup props (MNG-3979)
List<ModelProperty> p = new ArrayList<ModelProperty>();
for(ModelProperty mp : props)
{
if(mp.getResolvedValue() != null
&& mp.getResolvedValue().trim().equals(""))
{
int index = props.indexOf(mp) + 1;
if(index <= props.size() && mp.isParentOf(props.get(index)) && !props.get(index).getUri().contains("#property"))
{
p.add(new ModelProperty(mp.getUri(), null));
}
else
{
p.add(mp);
}
}
else
{
p.add(mp);
}
}
return factory.createDomainModel( p );
}
private static List<ModelProperty> transformDependencyManagement( List<ModelProperty> modelProperties )

View File

@ -166,7 +166,7 @@ public class PomConstructionTest
assertEquals( 4, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() );
}
/* FIXME: cf. MNG-3943*/
/* MNG-3943*/
public void testMergeOfPluginExecutionsWhenChildAndParentUseDifferentPluginVersions()
throws Exception
{
@ -217,7 +217,7 @@ public class PomConstructionTest
assertEquals( 1, ( (List<?>) pom.getValue( "build/pluginManagement/plugins[1]/executions[1]/goals" ) ).size() );
}
/* FIXME: cf. MNG-3937*/
/* MNG-3937*/
public void testOrderOfMergedPluginExecutionGoalsWithoutPluginManagement()
throws Exception
{
@ -252,7 +252,7 @@ public class PomConstructionTest
assertEquals( "child-non-default", pom.getValue( "build/plugins[1]/executions[@id='non-default']/phase" ) );
}
/* FIXME: cf. MNG-3938 */
/* MNG-3938 */
public void testOverridingOfInheritedPluginExecutionsWithPluginManagement()
throws Exception
{
@ -428,7 +428,7 @@ public class PomConstructionTest
assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/prop1" ).toString() ) );
}
/* FIXME: cf. MNG-3979
/* MNG-3979 */
public void testJoiningOfContainersWhenChildHasEmptyElements()
throws Exception
{