maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r688190 - in /maven/components/branches/maven-2.0.10-RC: ./ maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/lifecycle/ maven-core/src/main/resources/META-INF/plexus/ maven-model/src/main/mdo/ maven-plugi...
Date Fri, 22 Aug 2008 20:42:34 GMT
Author: jdcasey
Date: Fri Aug 22 13:42:33 2008
New Revision: 688190

URL: http://svn.apache.org/viewvc?rev=688190&view=rev
Log:
bumping plexus-interpolator to 1.4 (will be sync'ed to central soon now), and streamlining
some more code, including adding a new configuration interpolator to take advantage of the
reflective interpolation mechanism in the new model interpolator for the purposes of interpolating
Xpp3Doms (plugin configs).

Added:
    maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolationException.java
    maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java
    maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ReflectionConfigurationInterpolator.java
Modified:
    maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
    maven/components/branches/maven-2.0.10-RC/maven-core/src/main/resources/META-INF/plexus/components.xml
    maven/components/branches/maven-2.0.10-RC/maven-model/src/main/mdo/maven.mdo
    maven/components/branches/maven-2.0.10-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
    maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java
    maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java
    maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/BuildTimestampValueSource.java
    maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/StringSearchModelInterpolator.java
    maven/components/branches/maven-2.0.10-RC/pom.xml

Added: maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolationException.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolationException.java?rev=688190&view=auto
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolationException.java
(added)
+++ maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolationException.java
Fri Aug 22 13:42:33 2008
@@ -0,0 +1,19 @@
+package org.apache.maven;
+
+public class ConfigurationInterpolationException
+    extends Exception
+{
+
+    private static final long serialVersionUID = 1L;
+
+    public ConfigurationInterpolationException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public ConfigurationInterpolationException( String message )
+    {
+        super( message );
+    }
+
+}

Added: maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java?rev=688190&view=auto
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java
(added)
+++ maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ConfigurationInterpolator.java
Fri Aug 22 13:42:33 2008
@@ -0,0 +1,12 @@
+package org.apache.maven;
+
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilderConfiguration;
+
+public interface ConfigurationInterpolator
+{
+    
+    Object interpolate( Object configObject, MavenProject project, ProjectBuilderConfiguration
config )
+        throws ConfigurationInterpolationException;
+
+}

Added: maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ReflectionConfigurationInterpolator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ReflectionConfigurationInterpolator.java?rev=688190&view=auto
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ReflectionConfigurationInterpolator.java
(added)
+++ maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/ReflectionConfigurationInterpolator.java
Fri Aug 22 13:42:33 2008
@@ -0,0 +1,28 @@
+package org.apache.maven;
+
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilderConfiguration;
+import org.apache.maven.project.interpolation.ModelInterpolationException;
+import org.apache.maven.project.interpolation.StringSearchModelInterpolator;
+
+public class ReflectionConfigurationInterpolator
+    extends StringSearchModelInterpolator
+    implements ConfigurationInterpolator
+{
+
+    public Object interpolate( Object configObject, MavenProject project, ProjectBuilderConfiguration
config )
+        throws ConfigurationInterpolationException
+    {
+        try
+        {
+            interpolateObject( configObject, project.getModel(), project.getBasedir(), config,
getLogger().isDebugEnabled() );
+        }
+        catch ( ModelInterpolationException e )
+        {
+            throw new ConfigurationInterpolationException( "Error interpolating configuration
for project: " + project.getId() + "\n\n" + configObject, e );
+        }
+        
+        return configObject;
+    }
+
+}

Modified: maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
Fri Aug 22 13:42:33 2008
@@ -32,6 +32,8 @@
 import java.util.StringTokenizer;
 
 import org.apache.maven.BuildFailureException;
+import org.apache.maven.ConfigurationInterpolationException;
+import org.apache.maven.ConfigurationInterpolator;
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -120,6 +122,8 @@
     private MavenProjectBuilder mavenProjectBuilder;
 
     private ModelInterpolator modelInterpolator;
+    
+    private ConfigurationInterpolator configInterpolator;
 
     // ----------------------------------------------------------------------
     //
@@ -769,49 +773,17 @@
             return;
         }
         
-        StringWriter writer = new StringWriter();
-        Xpp3DomWriter.write( writer, mojoExecution.getConfiguration() );
-        
-        String domStr = writer.toString();
-        
-        if ( project == null )
-        {
-            try
-            {
-                project = mavenProjectBuilder.buildStandaloneSuperProject( session.getProjectBuilderConfiguration()
);
-            }
-            catch ( ProjectBuildingException e )
-            {
-                throw new LifecycleExecutionException( "Error building super-POM to interpolate
configuration for: '" + mojoExecution.getMojoDescriptor().getRoleHint() +
-                                                       "' (execution: '" + mojoExecution.getExecutionId()
+ "')", e );
-            }
-        }
-        
         try
         {
-            domStr =
-                modelInterpolator.interpolate( domStr, project.getModel(), project.getBasedir(),
-                                               session.getProjectBuilderConfiguration(),
getLogger().isDebugEnabled() );
+            mojoExecution.setConfiguration( (Xpp3Dom) configInterpolator.interpolate(
+                                                                                      mojoExecution.getConfiguration(),
+                                                                                      project,
+                                                                                      session.getProjectBuilderConfiguration()
) );
         }
-        catch ( ModelInterpolationException e )
+        catch ( ConfigurationInterpolationException e )
         {
             throw new LifecycleExecutionException( "Error interpolating configuration for:
'" + mojoExecution.getMojoDescriptor().getRoleHint() +
-                                              "' (execution: '" + mojoExecution.getExecutionId()
+ "')", e );
-        }
-        
-        try
-        {
-            mojoExecution.setConfiguration( Xpp3DomBuilder.build( new StringReader( domStr
) ) );
-        }
-        catch ( XmlPullParserException e )
-        {
-            throw new LifecycleExecutionException( "Error reading interpolated configuration
for: '" + mojoExecution.getMojoDescriptor().getRoleHint() +
-                                              "' (execution: '" + mojoExecution.getExecutionId()
+ "')", e );
-        }
-        catch ( IOException e )
-        {
-            throw new LifecycleExecutionException( "Error reading interpolated configuration
for: '" + mojoExecution.getMojoDescriptor().getRoleHint() +
-                                              "' (execution: '" + mojoExecution.getExecutionId()
+ "')", e );
+                                                   "' (execution: '" + mojoExecution.getExecutionId()
+ "')", e );
         }
     }
     

Modified: maven/components/branches/maven-2.0.10-RC/maven-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-core/src/main/resources/META-INF/plexus/components.xml?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-core/src/main/resources/META-INF/plexus/components.xml
Fri Aug 22 13:42:33 2008
@@ -206,6 +206,11 @@
       <implementation>org.apache.maven.usability.InvalidArtifactDiagnoser</implementation>
     </component>
 
+    <component>
+      <role>org.apache.maven.ConfigurationInterpolator</role>
+      <implementation>org.apache.maven.ReflectionConfigurationInterpolator</implementation>
+    </component>
+    
     <!--
      |
      | Lifecycle executor
@@ -230,6 +235,9 @@
         <requirement>
           <role>org.apache.maven.project.interpolation.ModelInterpolator</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.ConfigurationInterpolator</role>
+        </requirement>
       </requirements>
       <configuration>
         <lifecycles>

Modified: maven/components/branches/maven-2.0.10-RC/maven-model/src/main/mdo/maven.mdo
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-model/src/main/mdo/maven.mdo?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-model/src/main/mdo/maven.mdo (original)
+++ maven/components/branches/maven-2.0.10-RC/maven-model/src/main/mdo/maven.mdo Fri Aug 22
13:42:33 2008
@@ -2660,12 +2660,18 @@
         return executionMap;
     }
 
+    private String key;
+    
     /**
      * @return the key of the plugin, ie <code>groupId:artifactId</code>
      */
     public String getKey()
     {
-        return constructKey( groupId, artifactId );
+        if ( key == null )
+        {
+            key = constructKey( groupId, artifactId ).intern();
+        }
+        return key;
     }
 
     /**
@@ -2683,6 +2689,11 @@
      */
     public boolean equals( Object other )
     {
+        if ( this == other )
+        {
+            return true;
+        }
+        
         if ( other instanceof Plugin )
         {
             Plugin otherPlugin = (Plugin) other;

Modified: maven/components/branches/maven-2.0.10-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
Fri Aug 22 13:42:33 2008
@@ -137,15 +137,29 @@
     {
         return groupId + ":" + artifactId + ":" + version;
     }
+    
+    private String lookupKey;
 
     public String getPluginLookupKey()
     {
-        return groupId + ":" + artifactId;
+        if ( lookupKey == null )
+        {
+            lookupKey = groupId + ":" + artifactId.intern();
+        }
+        
+        return lookupKey;
     }
+    
+    private String id;
 
     public String getId()
     {
-        return constructPluginKey( groupId, artifactId, version );
+        if ( id == null )
+        {
+            id = constructPluginKey( groupId, artifactId, version ).intern();
+        }
+        
+        return id;
     }
 
     public static String getDefaultPluginArtifactId( String id )

Modified: maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Fri Aug 22 13:42:33 2008
@@ -1835,6 +1835,11 @@
     {
         if ( !project.isConcrete() )
         {
+            if ( project.getParent() != null )
+            {
+                calculateConcreteStateInternal( project.getParent(), config, processProjectReferences,
processedProjects );
+            }
+            
             Build build = project.getBuild();
             if ( build != null )
             {
@@ -1893,6 +1898,13 @@
             project.preserveProperties();
             project.preserveBasedir();
             project.setBuild( model.getBuild() );
+            
+            if ( project.getExecutionProject() != null )
+            {
+                calculateConcreteStateInternal( project.getExecutionProject(), config, processProjectReferences,
processedProjects );
+            }
+            
+            project.setConcrete( true );
         }
 
         if ( processProjectReferences )
@@ -1900,13 +1912,6 @@
             processedProjects.add( project.getId() );
             calculateConcreteProjectReferences( project, config, processedProjects );
         }
-
-        if ( project.getExecutionProject() != null )
-        {
-            calculateConcreteStateInternal( project.getExecutionProject(), config, processProjectReferences,
processedProjects );
-        }
-
-        project.setConcrete( true );
     }
 
     private void initResourceMergeIds( List resources )
@@ -1993,26 +1998,29 @@
     private void restoreDynamicStateInternal( MavenProject project, ProjectBuilderConfiguration
config, boolean processProjectReferences, Set processedProjects )
         throws ModelInterpolationException
     {
-        if ( !project.isConcrete() || !projectWasChanged( project ) )
+        if ( project.isConcrete() && projectWasChanged( project ) )
         {
-            return;
+            if ( project.getParent() != null )
+            {
+                restoreDynamicStateInternal( project.getParent(), config, processProjectReferences,
processedProjects );
+            }
+            
+            restoreBuildRoots( project, config, getLogger().isDebugEnabled() );
+            restoreModelBuildSection( project, config, getLogger().isDebugEnabled() );
+            
+            if ( project.getExecutionProject() != null )
+            {
+                restoreDynamicStateInternal( project.getExecutionProject(), config, processProjectReferences,
processedProjects );
+            }
+            
+            project.setConcrete( false );
         }
 
-        restoreBuildRoots( project, config, getLogger().isDebugEnabled() );
-        restoreModelBuildSection( project, config, getLogger().isDebugEnabled() );
-        
         if ( processProjectReferences )
         {
             processedProjects.add( project.getId() );
             restoreDynamicProjectReferences( project, config, processedProjects );
         }
-        
-        if ( project.getExecutionProject() != null )
-        {
-            restoreDynamicStateInternal( project.getExecutionProject(), config, processProjectReferences,
processedProjects );
-        }
-
-        project.setConcrete( false );
     }
 
     private boolean projectWasChanged( MavenProject project )

Modified: maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java
Fri Aug 22 13:42:33 2008
@@ -133,6 +133,14 @@
      * structures. Along with the {@link MavenProjectBuilder#restoreDynamicState(MavenProject,
ProjectBuilderConfiguration, boolean)}
      * method, this method allows expressions in these areas of the POM and project instance
to
      * be reevaluated in the event that a mojo changes one the build-path values, or a project
property.
+     * <br/><br/>
+     * This method will process the following:
+     * <ol>
+     *   <li>the specified project's parent project (if not null)</li>
+     *   <li>specified project</li>
+     *   <li>its execution project (if not null)</li>
+     *   <li>any project references (iff processReferences == true)</li>
+     * </ol>
      */
     void calculateConcreteState( MavenProject project, ProjectBuilderConfiguration config,
boolean processReferences )
         throws ModelInterpolationException;
@@ -151,6 +159,14 @@
      * any expressions that may depend on this changed information. This method will short-circuit
if the project
      * is not in a concrete state (see {@link MavenProjectBuilder#calculateConcreteState(MavenProject,
ProjectBuilderConfiguration, boolean)}
      * or if the properties and build paths of the project remain unchanged.
+     * <br/><br/>
+     * This method will process the following:
+     * <ol>
+     *   <li>the specified project's parent project (if not null)</li>
+     *   <li>specified project</li>
+     *   <li>its execution project (if not null)</li>
+     *   <li>any project references (iff processReferences == true)</li>
+     * </ol>
      */
     void restoreDynamicState( MavenProject project, ProjectBuilderConfiguration config, boolean
processReferences )
         throws ModelInterpolationException;

Modified: maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/AbstractStringBasedModelInterpolator.java
Fri Aug 22 13:42:33 2008
@@ -37,6 +37,7 @@
 import org.apache.maven.project.DefaultProjectBuilderConfiguration;
 import org.apache.maven.project.ProjectBuilderConfiguration;
 import org.apache.maven.project.path.PathTranslator;
+import org.codehaus.plexus.interpolation.AbstractValueSource;
 import org.codehaus.plexus.interpolation.InterpolationException;
 import org.codehaus.plexus.interpolation.InterpolationPostProcessor;
 import org.codehaus.plexus.interpolation.Interpolator;
@@ -201,10 +202,17 @@
                                boolean debug )
         throws ModelInterpolationException
     {
-        List valueSources = createValueSources( model, projectDir, config );
-        List postProcessors = createPostProcessors( model, projectDir, config );
-        
-        return interpolateInternal( src, valueSources, postProcessors, debug );
+        try
+        {
+            List valueSources = createValueSources( model, projectDir, config );
+            List postProcessors = createPostProcessors( model, projectDir, config );
+            
+            return interpolateInternal( src, valueSources, postProcessors, debug );
+        }
+        finally
+        {
+            interpolator.clearAnswers();
+        }
     }
     
     protected List createValueSources( final Model model, final File projectDir, final ProjectBuilderConfiguration
config )
@@ -220,7 +228,7 @@
         ValueSource modelValueSource1 = new PrefixedObjectValueSource( PROJECT_PREFIXES,
model, false );
         ValueSource modelValueSource2 = new ObjectBasedValueSource( model );
 
-        ValueSource basedirValueSource = new PrefixedValueSourceWrapper( new ValueSource(){
+        ValueSource basedirValueSource = new PrefixedValueSourceWrapper( new AbstractValueSource(
false ){
             public Object getValue( String expression )
             {
                 if ( projectDir != null && "basedir".equals( expression ) )
@@ -255,6 +263,11 @@
     protected String interpolateInternal( String src, List valueSources, List postProcessors,
boolean debug )
         throws ModelInterpolationException
     {
+        if ( src.indexOf( "${" ) < 0 )
+        {
+            return src;
+        }
+        
         Logger logger = getLogger();
 
         String result = src;
@@ -326,7 +339,7 @@
                     }
                 }
 
-//                interpolator.clearFeedback();
+                interpolator.clearFeedback();
             }
             finally
             {
@@ -349,11 +362,16 @@
     
     protected abstract Interpolator createInterpolator();
 
-    public void initialize()
+    public final void initialize()
         throws InitializationException
     {
         interpolator = createInterpolator();
         recursionInterceptor = new PrefixAwareRecursionInterceptor( PROJECT_PREFIXES );
     }
+    
+    protected final Interpolator getInterpolator()
+    {
+        return interpolator;
+    }
 
 }

Modified: maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/BuildTimestampValueSource.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/BuildTimestampValueSource.java?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/BuildTimestampValueSource.java
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/BuildTimestampValueSource.java
Fri Aug 22 13:42:33 2008
@@ -19,17 +19,17 @@
  * under the License.
  */
 
-import org.codehaus.plexus.interpolation.ValueSource;
-
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import org.codehaus.plexus.interpolation.AbstractValueSource;
+
 /**
  *
  * @version $Id$
  */
 public class BuildTimestampValueSource
-    implements ValueSource
+    extends AbstractValueSource
 {
 
     private final Date startTime;
@@ -40,6 +40,7 @@
 
     public BuildTimestampValueSource( Date startTime, String format )
     {
+        super( false );
         this.startTime = startTime;
         this.format = format;
     }

Modified: maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/StringSearchModelInterpolator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/StringSearchModelInterpolator.java?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/StringSearchModelInterpolator.java
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/interpolation/StringSearchModelInterpolator.java
Fri Aug 22 13:42:33 2008
@@ -20,6 +20,8 @@
 import org.codehaus.plexus.interpolation.StringSearchInterpolator;
 import org.codehaus.plexus.logging.Logger;
 
+import sun.security.action.GetIntegerAction;
+
 public class StringSearchModelInterpolator
     extends AbstractStringBasedModelInterpolator
 {
@@ -48,25 +50,35 @@
                                       boolean debugEnabled )
         throws ModelInterpolationException
     {
-        List valueSources = createValueSources( model, projectDir, config );
-        List postProcessors = createPostProcessors( model, projectDir, config );
-        
-        InterpolateObjectAction action =
-            new InterpolateObjectAction( obj, valueSources, postProcessors, debugEnabled,
-                                         this, getLogger() );
-        
-        ModelInterpolationException error =
-            (ModelInterpolationException) AccessController.doPrivileged( action );
-        
-        if ( error != null )
+        try
+        {
+            List valueSources = createValueSources( model, projectDir, config );
+            List postProcessors = createPostProcessors( model, projectDir, config );
+            
+            InterpolateObjectAction action =
+                new InterpolateObjectAction( obj, valueSources, postProcessors, debugEnabled,
+                                             this, getLogger() );
+            
+            ModelInterpolationException error =
+                (ModelInterpolationException) AccessController.doPrivileged( action );
+            
+            if ( error != null )
+            {
+                throw error;
+            }
+        }
+        finally
         {
-            throw error;
+            getInterpolator().clearAnswers();
         }
     }
 
     protected Interpolator createInterpolator()
     {
-        return new StringSearchInterpolator();
+        StringSearchInterpolator interpolator = new StringSearchInterpolator();
+        interpolator.setCacheAnswers( true );
+        
+        return interpolator;
     }
     
     private static final class InterpolateObjectAction implements PrivilegedAction

Modified: maven/components/branches/maven-2.0.10-RC/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/pom.xml?rev=688190&r1=688189&r2=688190&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/pom.xml (original)
+++ maven/components/branches/maven-2.0.10-RC/pom.xml Fri Aug 22 13:42:33 2008
@@ -244,9 +244,6 @@
   </modules>
 
   <properties>
-    <!--
-    <mavenHintDynamicBuild>true</mavenHintDynamicBuild>
-    -->
     <mavenVersion>2.0.10-RC10-SNAPSHOT</mavenVersion>
     <wagonVersion>1.0-beta-4</wagonVersion>
   </properties>
@@ -374,7 +371,7 @@
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-interpolation</artifactId>
-        <version>1.3</version>
+        <version>1.4</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>



Mime
View raw message