1 package org.apache.maven;
2
3 import org.apache.maven.project.MavenProject;
4 import org.apache.maven.project.ProjectBuilderConfiguration;
5 import org.apache.maven.project.interpolation.ModelInterpolationException;
6 import org.apache.maven.project.interpolation.StringSearchModelInterpolator;
7
8 public class ReflectionConfigurationInterpolator
9 extends StringSearchModelInterpolator
10 implements ConfigurationInterpolator
11 {
12
13 public Object interpolate( Object configObject, MavenProject project, ProjectBuilderConfiguration config )
14 throws ConfigurationInterpolationException
15 {
16 try
17 {
18 interpolateObject( configObject, project.getModel(), project.getBasedir(), config, getLogger().isDebugEnabled() );
19 }
20 catch ( ModelInterpolationException e )
21 {
22 throw new ConfigurationInterpolationException( "Error interpolating configuration for project: " + project.getId() + "\n\n" + configObject, e );
23 }
24
25 return configObject;
26 }
27
28 }