interpolator.addValueSource( vs );
}
for ( Iterator it = postProcessors.iterator(); it.hasNext(); )
{
InterpolationPostProcessor postProcessor = (InterpolationPostProcessor) it.next();
interpolator.addPostProcessor( postProcessor );
}
try
{
try
{
result = interpolator.interpolate( result, recursionInterceptor );
}
catch( InterpolationException e )
{
throw new ModelInterpolationException( e.getMessage(), e );
}
if ( debug )
{
List feedback = interpolator.getFeedback();
if ( feedback != null && !feedback.isEmpty() )
{
logger.debug( "Maven encountered the following problems during initial POM interpolation:" );
Object last = null;
for ( Iterator it = feedback.iterator(); it.hasNext(); )
{
Object next = it.next();
if ( next instanceof Throwable )
{
if ( last == null )
{
logger.debug( "", ( (Throwable) next ) );
}
else
{
logger.debug( String.valueOf( last ), ( (Throwable) next ) );
}
}
else
{
if ( last != null )
{
logger.debug( String.valueOf( last ) );
}
last = next;
}
}
if ( last != null )
{
logger.debug( String.valueOf( last ) );
}
}
}
interpolator.clearFeedback();
}
finally
{
for ( Iterator iterator = valueSources.iterator(); iterator.hasNext(); )
{
ValueSource vs = (ValueSource) iterator.next();
interpolator.removeValuesSource( vs );
}
for ( Iterator iterator = postProcessors.iterator(); iterator.hasNext(); )
{
InterpolationPostProcessor postProcessor = (InterpolationPostProcessor) iterator.next();
interpolator.removePostProcessor( postProcessor );
}
}
}