o merge back in the transform plugin management

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@726361 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2008-12-14 05:04:54 +00:00
parent 24cfa6f927
commit 9068bf5915
1 changed files with 25 additions and 31 deletions

View File

@ -145,8 +145,17 @@ public class PomTransformer
{
for ( ModelContainer managementContainer : source.queryFor( ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri ) )
{
managementContainer = new ArtifactModelContainerFactory().create(
transformPluginManagement( managementContainer.getProperties() ) );
List<ModelProperty> transformedProperties = new ArrayList<ModelProperty>();
for ( ModelProperty mp : managementContainer.getProperties() )
{
if ( mp.getUri().startsWith( ProjectUri.DependencyManagement.xUri ) )
{
transformedProperties.add( new ModelProperty(
mp.getUri().replace( ProjectUri.DependencyManagement.xUri, ProjectUri.xUri ), mp.getResolvedValue() ) );
}
}
managementContainer = new ArtifactModelContainerFactory().create( transformedProperties );
//Remove duplicate executions tags
@ -296,6 +305,20 @@ public class PomTransformer
return factory.createDomainModel( props );
}
private static List<ModelProperty> transformDependencyManagement( List<ModelProperty> modelProperties )
{
List<ModelProperty> transformedProperties = new ArrayList<ModelProperty>();
for ( ModelProperty mp : modelProperties )
{
if ( mp.getUri().startsWith( ProjectUri.DependencyManagement.xUri ) )
{
transformedProperties.add( new ModelProperty(
mp.getUri().replace( ProjectUri.DependencyManagement.xUri, ProjectUri.xUri ), mp.getResolvedValue() ) );
}
}
return transformedProperties;
}
/**
* @see ModelTransformer#transformToModelProperties(java.util.List)
*/
@ -751,35 +774,6 @@ public class PomTransformer
return null;
}
private static List<ModelProperty> transformDependencyManagement( List<ModelProperty> modelProperties )
{
List<ModelProperty> transformedProperties = new ArrayList<ModelProperty>();
for ( ModelProperty mp : modelProperties )
{
if ( mp.getUri().startsWith( ProjectUri.DependencyManagement.xUri ) )
{
transformedProperties.add( new ModelProperty(
mp.getUri().replace( ProjectUri.DependencyManagement.xUri, ProjectUri.xUri ), mp.getResolvedValue() ) );
}
}
return transformedProperties;
}
private static List<ModelProperty> transformPluginManagement( List<ModelProperty> modelProperties )
{
List<ModelProperty> transformedProperties = new ArrayList<ModelProperty>();
for ( ModelProperty mp : modelProperties )
{
if ( mp.getUri().startsWith( ProjectUri.Build.PluginManagement.xUri ) )
{
transformedProperties.add( new ModelProperty(
mp.getUri().replace( ProjectUri.Build.PluginManagement.xUri, ProjectUri.Build.xUri ),
mp.getResolvedValue() ) );
}
}
return transformedProperties;
}
private static List<ModelProperty> transformPlugin( List<ModelProperty> modelProperties )
{
List<ModelProperty> transformedProperties = new ArrayList<ModelProperty>();