Some ITs were failing because of the new interpolation code. Certains code paths were failing because they did not add CDATA sections to the pom. Added CDATA support directly to ModelProperty so path doesn't matter.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@694999 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2008-09-13 18:21:29 +00:00
parent 9fff4c0612
commit c5f52578f5
2 changed files with 8 additions and 13 deletions

View File

@ -132,18 +132,7 @@ public final class PomClassicTransformer
throw new IllegalArgumentException( "properties: null" );
}
List<ModelProperty> props = new ArrayList<ModelProperty>();
for ( ModelProperty mp : properties )
{ //TODO: Resolved values
if ( mp.getResolvedValue() != null && ( mp.getResolvedValue().contains( "=" ) || mp.getResolvedValue().contains( "<" ) ) )
{
props.add( new ModelProperty( mp.getUri(), "<![CDATA[" + mp.getResolvedValue() + "]]>" ) );
}
else
{
props.add( mp );
}
}
List<ModelProperty> props = new ArrayList<ModelProperty>( properties );
//dependency management
ModelDataSource source = new DefaultModelDataSource();
@ -496,6 +485,7 @@ public final class PomClassicTransformer
}
interpolateModelProperties( modelProperties, interpolatorProperties, ((PomClassicDomainModel) domainModels.get(0)) );
return modelProperties;
}

View File

@ -124,12 +124,17 @@ public final class ModelProperty
}
/**
* Value of this model property after interpolation.
* Value of this model property after interpolation. CDATA section will be added if needed.
*
* @return value of this model property after interpolation
*/
public String getResolvedValue()
{
if( resolvedValue != null && !resolvedValue.startsWith ("<![CDATA[")
&& (resolvedValue.contains( "=" ) || resolvedValue.contains( "<" )))
{
resolvedValue = "<![CDATA[" + resolvedValue + "]]>";
}
return resolvedValue;
}