You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2008/06/06 23:50:53 UTC

svn commit: r664147 - in /maven/components/branches/john-2.0.x-dynamicBuild: ./ maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/execution/ maven-core/src/main/java/org/apache/maven/plugin/ maven-project/src/main/jav...

Author: jdcasey
Date: Fri Jun  6 14:50:53 2008
New Revision: 664147

URL: http://svn.apache.org/viewvc?rev=664147&view=rev
Log:
Adding code to handle dynamism in the build section of the POM...still needs work, though, with two failing unit tests. Then, need to verify integration tests before this is ready for discussion.

Added:
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java   (with props)
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom-relative.xml   (with props)
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom.xml   (with props)
Modified:
    maven/components/branches/john-2.0.x-dynamicBuild/build.xml
    maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java
    maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java

Modified: maven/components/branches/john-2.0.x-dynamicBuild/build.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/build.xml?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/build.xml (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/build.xml Fri Jun  6 14:50:53 2008
@@ -143,6 +143,7 @@
     <java fork="true" classname="org.apache.maven.cli.MavenCli" failonerror="true">
       <classpath refid="maven.classpath"/>
       <arg value="-B"/>
+      <arg value="-X"/>
       <arg value="clean"/>
       <arg value="install"/>
     </java>

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/DefaultMaven.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/DefaultMaven.java Fri Jun  6 14:50:53 2008
@@ -597,7 +597,7 @@
     {
         return new MavenSession( container, request.getSettings(), request.getLocalRepository(),
                                  request.getEventDispatcher(), rpm, request.getGoals(), request.getBaseDirectory(),
-                                 request.getExecutionProperties(), request.getStartTime() );
+                                 request.getExecutionProperties(), request.getUserProperties(), request.getStartTime() );
     }
 
     /**

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java Fri Jun  6 14:50:53 2008
@@ -57,14 +57,23 @@
 
     private final Properties executionProperties;
 
+    private Properties userProperties;
+
     private final Date startTime;
-    
+
     private MavenProject currentProject;
 
     public MavenSession( PlexusContainer container, Settings settings, ArtifactRepository localRepository,
                          EventDispatcher eventDispatcher, ReactorManager reactorManager, List goals,
                          String executionRootDir, Properties executionProperties, Date startTime )
     {
+        this( container, settings, localRepository, eventDispatcher, reactorManager, goals, executionRootDir, executionProperties, null, startTime );
+    }
+
+    public MavenSession( PlexusContainer container, Settings settings, ArtifactRepository localRepository,
+                         EventDispatcher eventDispatcher, ReactorManager reactorManager, List goals,
+                         String executionRootDir, Properties executionProperties, Properties userProperties, Date startTime )
+    {
         this.container = container;
 
         this.settings = settings;
@@ -171,7 +180,7 @@
     {
         return startTime;
     }
-    
+
     public void setCurrentProject( MavenProject currentProject )
     {
         this.currentProject = currentProject;
@@ -184,5 +193,16 @@
     {
         return currentProject;
     }
-    
+
+
+    public Properties getUserProperties()
+    {
+        return userProperties;
+    }
+
+    public void setUserProperties( Properties userProperties )
+    {
+        this.userProperties = userProperties;
+    }
+
 }
\ No newline at end of file

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java Fri Jun  6 14:50:53 2008
@@ -20,20 +20,6 @@
  * under the License.
  */
 
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import org.apache.maven.MavenArtifactFilterManager;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -66,11 +52,14 @@
 import org.apache.maven.plugin.version.PluginVersionManager;
 import org.apache.maven.plugin.version.PluginVersionNotFoundException;
 import org.apache.maven.plugin.version.PluginVersionResolutionException;
+import org.apache.maven.project.DefaultProjectBuilderConfiguration;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuilderConfiguration;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.apache.maven.project.artifact.MavenMetadataSource;
+import org.apache.maven.project.interpolation.ModelInterpolationException;
 import org.apache.maven.project.path.PathTranslator;
 import org.apache.maven.reporting.MavenReport;
 import org.apache.maven.settings.Settings;
@@ -96,6 +85,20 @@
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 public class DefaultPluginManager
     extends AbstractLogEnabled
     implements PluginManager, Initializable, Contextualizable
@@ -426,6 +429,20 @@
             dom = Xpp3Dom.mergeXpp3Dom( dom, mojoExecution.getConfiguration() );
         }
 
+        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
+        config.setExecutionProperties( session.getExecutionProperties() );
+        config.setLocalRepository( session.getLocalRepository() );
+        config.setUserProperties( session.getUserProperties() );
+
+        try
+        {
+            mavenProjectBuilder.calculateConcreteState( project, config );
+        }
+        catch ( ModelInterpolationException e )
+        {
+            throw new PluginManagerException( "Failed to calculate concrete state for project: " + project, e );
+        }
+
         plugin = getConfiguredMojo( session, dom, project, false, mojoExecution );
 
         // Event monitoring.
@@ -522,6 +539,15 @@
                 }
             }
         }
+
+        try
+        {
+            mavenProjectBuilder.restoreDynamicState( project, config );
+        }
+        catch ( ModelInterpolationException e )
+        {
+            throw new PluginManagerException( "Failed to restore dynamic state for project: " + project, e );
+        }
     }
 
     public MavenReport getReport( MavenProject project,
@@ -1408,7 +1434,7 @@
         {
             project.setDependencyArtifacts( project.createArtifacts( artifactFactory, null, null ) );
         }
-        
+
         Set resolvedArtifacts;
         try
         {
@@ -1423,7 +1449,7 @@
         catch (MultipleArtifactsNotFoundException me)
         {
             /*only do this if we are an aggregating plugin: MNG-2277
-            if the dependency doesn't yet exist but is in the reactor, then 
+            if the dependency doesn't yet exist but is in the reactor, then
             all we can do is warn and skip it. A better fix can be inserted into 2.1*/
             if (isAggregator && checkMissingArtifactsInReactor( context.getSortedProjects(), me.getMissingArtifacts() ))
             {
@@ -1466,19 +1492,19 @@
                     //most likely it would be produced by the project we just found in the reactor since all
                     //the other info matches. Assume it's ok.
                     getLogger().warn( "The dependency: "+ p.getId()+" can't be resolved but has been found in the reactor.\nThis dependency has been excluded from the plugin execution. You should rerun this mojo after executing mvn install.\n" );
-                    
+
                     //found it, move on.
                     foundInReactor.add( p );
                     break;
-                }   
+                }
             }
         }
-        
+
         //if all of them have been found, we can continue.
         return foundInReactor.size() == missing.size();
     }
-    
-    
+
+
     // ----------------------------------------------------------------------
     // Artifact downloading
     // ----------------------------------------------------------------------

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java Fri Jun  6 14:50:53 2008
@@ -49,6 +49,7 @@
 import org.apache.maven.model.Profile;
 import org.apache.maven.model.ReportPlugin;
 import org.apache.maven.model.Repository;
+import org.apache.maven.model.Resource;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.profiles.DefaultProfileManager;
 import org.apache.maven.profiles.MavenProfilesBuilder;
@@ -893,10 +894,6 @@
         // this only happens if we are building from a source file
         if ( projectDescriptor != null )
         {
-            // Only translate the base directory for files in the source tree
-            pathTranslator.alignToBaseDirectory( project.getModel(),
-                                                 projectDir );
-
             Build build = project.getBuild();
 
             project.addCompileSourceRoot( build.getSourceDirectory() );
@@ -1013,6 +1010,9 @@
             }
         }
 
+        Build dynamicBuild = model.getBuild();
+        model.setBuild( new Build() );
+
         model = modelInterpolator.interpolate( model, context, strict );
 
         // second pass allows ${user.home} to work, if it needs to.
@@ -1024,6 +1024,8 @@
 
         model = modelInterpolator.interpolate( model, context, strict );
 
+        model.setBuild( dynamicBuild );
+
         // MNG-3482: Make sure depMgmt is interpolated before merging.
         if ( !isSuperPom )
         {
@@ -1778,4 +1780,459 @@
         container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
     }
 
+    public void calculateConcreteState( MavenProject project, ProjectBuilderConfiguration config )
+        throws ModelInterpolationException
+    {
+        if ( project.isConcrete() )
+        {
+            return;
+        }
+
+        Model model = ModelUtils.cloneModel( project.getModel() );
+
+        // We don't need all the project methods that are added over those in the model, but we do need basedir
+        Map context = new HashMap();
+
+        populateBuildPaths( model.getBuild(), context, project.getBasedir() );
+//        if ( !isSuperPom )
+//        {
+//            Properties userProps = session.getUserProperties();
+//            if ( userProps != null )
+//            {
+//                context.putAll( userProps );
+//            }
+//        }
+
+        model = modelInterpolator.interpolate( model, context, true );
+
+        populateExecutionProperties( config, context );
+
+        model = modelInterpolator.interpolate( model, context, true );
+
+        File basedir = project.getBasedir();
+
+        List originalInterpolatedCompileSourceRoots = interpolateListOfStrings( project.getCompileSourceRoots(),
+                                                                           model,
+                                                                           context );
+
+        project.preserveCompileSourceRoots( originalInterpolatedCompileSourceRoots );
+
+        project.setCompileSourceRoots( originalInterpolatedCompileSourceRoots == null ? null
+                        : translateListOfPaths( originalInterpolatedCompileSourceRoots, basedir ) );
+
+        List originalInterpolatedTestCompileSourceRoots = interpolateListOfStrings( project.getTestCompileSourceRoots(),
+                                                                               model,
+                                                                               context );
+
+        project.preserveTestCompileSourceRoots( originalInterpolatedTestCompileSourceRoots );
+        project.setTestCompileSourceRoots( originalInterpolatedTestCompileSourceRoots == null ? null
+                        : translateListOfPaths( originalInterpolatedTestCompileSourceRoots, basedir ) );
+
+        List originalInterpolatedScriptSourceRoots = interpolateListOfStrings( project.getScriptSourceRoots(),
+                                                                          model,
+                                                                          context );
+
+        project.preserveScriptSourceRoots( originalInterpolatedScriptSourceRoots );
+        project.setScriptSourceRoots( originalInterpolatedScriptSourceRoots == null ? null
+                        : translateListOfPaths( originalInterpolatedScriptSourceRoots, basedir ) );
+
+        Model model2 = ModelUtils.cloneModel( model );
+
+        // Only translate the base directory for files in the source tree
+        pathTranslator.alignToBaseDirectory( model, basedir );
+
+        project.preserveBuild( model2.getBuild() );
+        project.setBuild( model.getBuild() );
+
+        calculateConcreteProjectReferences( project, config );
+
+        project.setConcrete( true );
+    }
+
+    private void calculateConcreteProjectReferences( MavenProject project,
+                                                     ProjectBuilderConfiguration config )
+        throws ModelInterpolationException
+    {
+        Map projectRefs = project.getProjectReferences();
+
+        if ( projectRefs != null )
+        {
+            for ( Iterator it = projectRefs.values().iterator(); it.hasNext(); )
+            {
+                MavenProject reference = (MavenProject) it.next();
+                calculateConcreteState( reference, config );
+            }
+        }
+    }
+
+    private List translateListOfPaths( List paths, File basedir )
+    {
+        if ( paths == null )
+        {
+            return null;
+        }
+        else if ( basedir == null )
+        {
+            return paths;
+        }
+
+        List result = new ArrayList( paths.size() );
+        for ( Iterator it = paths.iterator(); it.hasNext(); )
+        {
+            String path = (String) it.next();
+
+            // Only translate the base directory for files in the source tree
+            result.add( pathTranslator.alignToBaseDirectory( path, basedir ) );
+        }
+
+        return result;
+    }
+
+    public void restoreDynamicState( MavenProject project, ProjectBuilderConfiguration config )
+        throws ModelInterpolationException
+    {
+        if ( !project.isConcrete() )
+        {
+            return;
+        }
+
+        Build changedBuild = project.getBuild();
+
+        Map context = new HashMap();
+        populateBuildPaths( changedBuild, context, project.getBasedir() );
+        populateExecutionProperties( config, context );
+
+        restoreBuildRoots( project, config, context );
+        restoreModelBuildSection( project, config, context );
+
+        restoreDynamicProjectReferences( project, config );
+
+        project.setConcrete( false );
+    }
+
+    private void restoreDynamicProjectReferences( MavenProject project,
+                                                  ProjectBuilderConfiguration config )
+        throws ModelInterpolationException
+    {
+        Map projectRefs = project.getProjectReferences();
+        if ( projectRefs != null )
+        {
+            for ( Iterator it = projectRefs.values().iterator(); it.hasNext(); )
+            {
+                MavenProject projectRef = (MavenProject) it.next();
+                restoreDynamicState( projectRef, config );
+            }
+        }
+    }
+
+    private void restoreBuildRoots( MavenProject project,
+                                    ProjectBuilderConfiguration config,
+                                    Map context )
+        throws ModelInterpolationException
+    {
+        project.setCompileSourceRoots( restoreListOfStrings( project.getDynamicCompileSourceRoots(),
+                                                             project.getOriginalInterpolatedCompileSourceRoots(),
+                                                             project.getCompileSourceRoots(),
+                                                             project,
+                                                             context ) );
+
+        project.setTestCompileSourceRoots( restoreListOfStrings( project.getDynamicTestCompileSourceRoots(),
+                                                                 project.getOriginalInterpolatedTestCompileSourceRoots(),
+                                                                 project.getTestCompileSourceRoots(),
+                                                                 project,
+                                                                 context ) );
+
+        project.setScriptSourceRoots( restoreListOfStrings( project.getDynamicScriptSourceRoots(),
+                                                            project.getOriginalInterpolatedScriptSourceRoots(),
+                                                            project.getScriptSourceRoots(),
+                                                            project,
+                                                            context ) );
+
+        project.clearRestorableRoots();
+    }
+
+    private void restoreModelBuildSection( MavenProject project,
+                                           ProjectBuilderConfiguration config,
+                                           Map context )
+        throws ModelInterpolationException
+    {
+        Build changedBuild = project.getBuild();
+        Build dynamicBuild = project.getDynamicBuild();
+        Build originalInterpolatedBuild = project.getOriginalInterpolatedBuild();
+
+        dynamicBuild.setResources( restoreResources( dynamicBuild.getResources(),
+                                                         originalInterpolatedBuild.getResources(),
+                                                         changedBuild.getResources(),
+                                                         project,
+                                                         context ) );
+
+        dynamicBuild.setTestResources( restoreResources( dynamicBuild.getTestResources(),
+                                                         originalInterpolatedBuild.getTestResources(),
+                                                         changedBuild.getTestResources(),
+                                                         project,
+                                                         context ) );
+
+        dynamicBuild.setFilters( restoreListOfStrings( dynamicBuild.getFilters(),
+                                                           originalInterpolatedBuild.getFilters(),
+                                                           changedBuild.getFilters(),
+                                                           project,
+                                                           context ) );
+
+        dynamicBuild.setSourceDirectory( restoreString( dynamicBuild.getSourceDirectory(),
+                                                            originalInterpolatedBuild.getSourceDirectory(),
+                                                            changedBuild.getSourceDirectory(),
+                                                            project,
+                                                            context ) );
+
+        dynamicBuild.setTestSourceDirectory( restoreString( dynamicBuild.getTestSourceDirectory(),
+                                                                originalInterpolatedBuild.getTestSourceDirectory(),
+                                                                changedBuild.getTestSourceDirectory(),
+                                                                project,
+                                                                context ) );
+
+        dynamicBuild.setScriptSourceDirectory( restoreString( dynamicBuild.getScriptSourceDirectory(),
+                                                                  originalInterpolatedBuild.getScriptSourceDirectory(),
+                                                                  changedBuild.getScriptSourceDirectory(),
+                                                                  project,
+                                                                  context ) );
+
+        dynamicBuild.setOutputDirectory( restoreString( dynamicBuild.getOutputDirectory(),
+                                                            originalInterpolatedBuild.getOutputDirectory(),
+                                                            changedBuild.getOutputDirectory(),
+                                                            project,
+                                                            context ) );
+
+        dynamicBuild.setTestOutputDirectory( restoreString( dynamicBuild.getTestOutputDirectory(),
+                                                                originalInterpolatedBuild.getTestOutputDirectory(),
+                                                                changedBuild.getTestOutputDirectory(),
+                                                                project,
+                                                                context ) );
+
+        dynamicBuild.setDirectory( restoreString( dynamicBuild.getDirectory(),
+                                                      originalInterpolatedBuild.getDirectory(),
+                                                      changedBuild.getDirectory(),
+                                                      project,
+                                                      context ) );
+
+        project.setBuild( dynamicBuild );
+
+        project.clearRestorableBuild();
+    }
+
+    private List interpolateListOfStrings( List originalStrings,
+                                           Model model,
+                                           Map context )
+        throws ModelInterpolationException
+    {
+        if ( originalStrings == null )
+        {
+            return null;
+        }
+
+        List result = new ArrayList();
+
+        for ( Iterator it = originalStrings.iterator(); it.hasNext(); )
+        {
+            String original = (String) it.next();
+            result.add( modelInterpolator.interpolate( original, model, context ) );
+        }
+
+        return result;
+    }
+
+    private String restoreString( String originalString,
+                                      String originalInterpolatedString,
+                                      String changedString,
+                                      MavenProject project,
+                                      Map context )
+        throws ModelInterpolationException
+    {
+        if ( originalString == null )
+        {
+            return changedString;
+        }
+        else if ( changedString == null )
+        {
+            return originalString;
+        }
+
+        Model model = project.getModel();
+
+        String relativeChangedString = pathTranslator.unalignFromBaseDirectory( changedString, project.getBasedir() );
+
+        String interpolatedOriginal = modelInterpolator.interpolate( originalString, model, context );
+        String interpolatedOriginal2 = modelInterpolator.interpolate( originalInterpolatedString,
+                                                                 model,
+                                                                 context );
+
+        String interpolatedChanged = modelInterpolator.interpolate( changedString, model, context );
+        String relativeInterpolatedChanged = modelInterpolator.interpolate( relativeChangedString, model, context );
+
+        if ( interpolatedOriginal.equals( interpolatedChanged )
+             || interpolatedOriginal2.equals( interpolatedChanged ) )
+        {
+            return originalString;
+        }
+        else if ( interpolatedOriginal.equals( relativeInterpolatedChanged )
+                        || interpolatedOriginal2.equals( relativeInterpolatedChanged ) )
+       {
+           return originalString;
+       }
+
+        return relativeChangedString;
+    }
+
+    private List restoreListOfStrings( List originalStrings,
+                                           List originalInterpolatedStrings,
+                                           List changedStrings,
+                                           MavenProject project,
+                                           Map context )
+        throws ModelInterpolationException
+    {
+        if ( originalStrings == null )
+        {
+            return changedStrings;
+        }
+        else if ( changedStrings == null )
+        {
+            return originalStrings;
+        }
+
+        List result = new ArrayList();
+
+        Map orig = new HashMap();
+        for ( int idx = 0; idx < originalStrings.size(); idx++ )
+        {
+            String[] permutations = new String[2];
+
+            permutations[0] = (String) originalInterpolatedStrings.get( idx );
+            permutations[1] = (String) originalStrings.get( idx );
+
+            orig.put( permutations[0], permutations );
+        }
+
+        for ( Iterator it = changedStrings.iterator(); it.hasNext(); )
+        {
+            String changedString = (String) it.next();
+            String relativeChangedString = pathTranslator.unalignFromBaseDirectory( changedString, project.getBasedir() );
+
+            String interpolated = modelInterpolator.interpolate( changedString, project.getModel(), orig );
+            String relativeInterpolated = modelInterpolator.interpolate( relativeChangedString, project.getModel(), orig );
+
+            String[] original = (String[]) orig.get( interpolated );
+            if ( original == null )
+            {
+                original = (String[]) orig.get( relativeInterpolated );
+            }
+
+            if ( original == null )
+            {
+                result.add( relativeChangedString );
+            }
+            else
+            {
+                result.add( original[1] );
+            }
+        }
+
+        return result;
+    }
+
+    private List restoreResources( List originalResources,
+                                       List originalInterpolatedResources,
+                                       List changedResources,
+                                       MavenProject project,
+                                       Map context )
+        throws ModelInterpolationException
+    {
+        if ( originalResources == null || changedResources == null )
+        {
+            return originalResources;
+        }
+
+        List result = new ArrayList();
+
+        Map orig = new HashMap();
+        for ( int idx = 0; idx < originalResources.size(); idx++ )
+        {
+            Resource[] permutations = new Resource[2];
+
+            permutations[0] = (Resource) originalInterpolatedResources.get( idx );
+            permutations[1] = (Resource) originalResources.get( idx );
+
+            orig.put( permutations[0].getDirectory(), permutations );
+        }
+
+        for ( Iterator it = changedResources.iterator(); it.hasNext(); )
+        {
+            Resource resource = (Resource) it.next();
+            String rDir = modelInterpolator.interpolate( resource.getDirectory(), project.getModel(), orig );
+
+            String relativeDir = pathTranslator.unalignFromBaseDirectory( resource.getDirectory(), project.getBasedir() );
+            String relativeRDir = modelInterpolator.interpolate( relativeDir, project.getModel(), context );
+
+            Resource[] original = (Resource[]) orig.get( rDir );
+            if ( original == null )
+            {
+                original = (Resource[]) orig.get( relativeRDir );
+            }
+
+            if ( original == null )
+            {
+                result.add( resource );
+            }
+            else
+            {
+                // TODO: Synchronize all non-directory fields, such as targetPath, includes, and excludes.
+//                String target = interpolator.interpolate( resource.getTargetPath(), model, context );
+//                String oTarget = interpolator.interpolate( originalResource.getTargetPath(), model, context );
+
+                result.add( original[1] );
+            }
+        }
+
+        return result;
+    }
+
+    private void populateExecutionProperties( ProjectBuilderConfiguration config,
+                                              Map context )
+    {
+        // second pass allows ${user.home} to work, if it needs to.
+        // [MNG-2339] ensure the system properties are still interpolated for backwards compat, but the model values must win
+        if ( config.getExecutionProperties() != null
+             && !config.getExecutionProperties().isEmpty() )
+        {
+            context.putAll( config.getExecutionProperties() );
+        }
+    }
+
+    private void populateBuildPaths( Build build,
+                                     Map context,
+                                     File projectDir )
+    {
+        if ( projectDir != null )
+        {
+            context.put( "basedir", projectDir.getAbsolutePath() );
+
+            // MNG-1927, MNG-2124, MNG-3355:
+            // If the build section is present and the project directory is non-null, we should make
+            // sure interpolation of the directories below uses translated paths.
+            // Afterward, we'll double back and translate any paths that weren't covered during interpolation via the
+            // code below...
+            context.put( "build.directory",
+                         pathTranslator.alignToBaseDirectory( build.getDirectory(), projectDir ) );
+            context.put( "build.outputDirectory",
+                         pathTranslator.alignToBaseDirectory( build.getOutputDirectory(),
+                                                              projectDir ) );
+            context.put( "build.testOutputDirectory",
+                         pathTranslator.alignToBaseDirectory( build.getTestOutputDirectory(),
+                                                              projectDir ) );
+            context.put( "build.sourceDirectory",
+                         pathTranslator.alignToBaseDirectory( build.getSourceDirectory(),
+                                                              projectDir ) );
+            context.put( "build.testSourceDirectory",
+                         pathTranslator.alignToBaseDirectory( build.getTestSourceDirectory(),
+                                                              projectDir ) );
+        }
+    }
 }

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProject.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProject.java Fri Jun  6 14:50:53 2008
@@ -277,6 +277,35 @@
         {
             setSnapshotArtifactRepository( project.getSnapshotArtifactRepository() );
         }
+
+        if ( project.isConcrete() )
+        {
+            setDynamicBuild( ModelUtils.cloneBuild( project.getDynamicBuild() ) );
+            setOriginalInterpolatedBuild( ModelUtils.cloneBuild( project.getOriginalInterpolatedBuild() ) );
+
+            List dynamicRoots = project.getDynamicCompileSourceRoots();
+            if ( dynamicRoots != null )
+            {
+                setDynamicCompileSourceRoots( new ArrayList( dynamicRoots ) );
+                setOriginalInterpolatedCompileSourceRoots( new ArrayList( project.getOriginalInterpolatedCompileSourceRoots() ) );
+            }
+
+            dynamicRoots = project.getDynamicTestCompileSourceRoots();
+            if ( dynamicRoots != null )
+            {
+                setDynamicTestCompileSourceRoots( new ArrayList( dynamicRoots ) );
+                setOriginalInterpolatedTestCompileSourceRoots( new ArrayList( project.getOriginalInterpolatedTestCompileSourceRoots() ) );
+            }
+
+            dynamicRoots = project.getDynamicScriptSourceRoots();
+            if ( dynamicRoots != null )
+            {
+                setDynamicScriptSourceRoots( new ArrayList( dynamicRoots ) );
+                setOriginalInterpolatedScriptSourceRoots( new ArrayList( project.getOriginalInterpolatedScriptSourceRoots() ) );
+            }
+        }
+
+        setConcrete( project.isConcrete() );
     }
 
     public String getModulePathAdjustment( MavenProject moduleProject ) throws IOException
@@ -1573,7 +1602,7 @@
         projectReferences.put( getProjectReferenceId( project.getGroupId(), project.getArtifactId(), project.getVersion() ), project );
     }
 
-    private static String getProjectReferenceId( String groupId, String artifactId, String version )
+    public static String getProjectReferenceId( String groupId, String artifactId, String version )
     {
         return groupId + ":" + artifactId + ":" + version;
     }
@@ -1785,4 +1814,159 @@
         return clone;
     }
 
+// ----------------------------------------------------------------------------
+// CODE BELOW IS USED TO PRESERVE DYNAMISM IN THE BUILD SECTION OF THE POM.
+// ----------------------------------------------------------------------------
+
+    private Build dynamicBuild;
+
+    private Build originalInterpolatedBuild;
+
+    private List dynamicCompileSourceRoots;
+
+    private List originalInterpolatedCompileSourceRoots;
+
+    private List dynamicTestCompileSourceRoots;
+
+    private List originalInterpolatedTestCompileSourceRoots;
+
+    private List dynamicScriptSourceRoots;
+
+    private List originalInterpolatedScriptSourceRoots;
+
+    private boolean isConcrete = false;
+
+    public boolean isConcrete()
+    {
+        return isConcrete;
+    }
+
+    public void setConcrete( boolean concrete )
+    {
+        isConcrete = concrete;
+    }
+
+    public Build getDynamicBuild()
+    {
+        return dynamicBuild;
+    }
+
+    public Build getOriginalInterpolatedBuild()
+    {
+        return originalInterpolatedBuild;
+    }
+
+    public List getDynamicCompileSourceRoots()
+    {
+        return dynamicCompileSourceRoots;
+    }
+
+    public List getOriginalInterpolatedCompileSourceRoots()
+    {
+        return originalInterpolatedCompileSourceRoots;
+    }
+
+    public List getDynamicTestCompileSourceRoots()
+    {
+        return dynamicTestCompileSourceRoots;
+    }
+
+    public List getOriginalInterpolatedTestCompileSourceRoots()
+    {
+        return originalInterpolatedTestCompileSourceRoots;
+    }
+
+    public List getDynamicScriptSourceRoots()
+    {
+        return dynamicScriptSourceRoots;
+    }
+
+    public List getOriginalInterpolatedScriptSourceRoots()
+    {
+        return originalInterpolatedScriptSourceRoots;
+    }
+
+    public void clearRestorableRoots()
+    {
+        dynamicCompileSourceRoots = null;
+        dynamicTestCompileSourceRoots = null;
+        dynamicScriptSourceRoots = null;
+        originalInterpolatedCompileSourceRoots = null;
+        originalInterpolatedScriptSourceRoots = null;
+        originalInterpolatedTestCompileSourceRoots = null;
+    }
+
+    public void clearRestorableBuild()
+    {
+        dynamicBuild = null;
+        originalInterpolatedBuild = null;
+    }
+
+    public void preserveCompileSourceRoots( List originalInterpolatedCompileSourceRoots )
+    {
+        dynamicCompileSourceRoots = getCompileSourceRoots();
+        this.originalInterpolatedCompileSourceRoots = originalInterpolatedCompileSourceRoots;
+    }
+
+    public void preserveTestCompileSourceRoots( List originalInterpolatedTestCompileSourceRoots )
+    {
+        dynamicTestCompileSourceRoots = getTestCompileSourceRoots();
+        this.originalInterpolatedTestCompileSourceRoots = originalInterpolatedTestCompileSourceRoots;
+    }
+
+    public void preserveScriptSourceRoots( List originalInterpolatedScriptSourceRoots )
+    {
+        dynamicScriptSourceRoots = getScriptSourceRoots();
+        this.originalInterpolatedScriptSourceRoots = originalInterpolatedScriptSourceRoots;
+    }
+
+    public void preserveBuild( Build originalInterpolatedBuild )
+    {
+        dynamicBuild = getBuild();
+        this.originalInterpolatedBuild = originalInterpolatedBuild;
+
+        this.originalInterpolatedBuild.setPluginManagement( null );
+        this.originalInterpolatedBuild.setPlugins( null );
+    }
+
+    protected void setDynamicBuild( Build dynamicBuild )
+    {
+        this.dynamicBuild = dynamicBuild;
+    }
+
+    protected void setOriginalInterpolatedBuild( Build originalInterpolatedBuild )
+    {
+        this.originalInterpolatedBuild = originalInterpolatedBuild;
+    }
+
+    protected void setDynamicCompileSourceRoots( List dynamicCompileSourceRoots )
+    {
+        this.dynamicCompileSourceRoots = dynamicCompileSourceRoots;
+    }
+
+    protected void setOriginalInterpolatedCompileSourceRoots( List originalInterpolatedCompileSourceRoots )
+    {
+        this.originalInterpolatedCompileSourceRoots = originalInterpolatedCompileSourceRoots;
+    }
+
+    protected void setDynamicTestCompileSourceRoots( List dynamicTestCompileSourceRoots )
+    {
+        this.dynamicTestCompileSourceRoots = dynamicTestCompileSourceRoots;
+    }
+
+    protected void setOriginalInterpolatedTestCompileSourceRoots( List originalInterpolatedTestCompileSourceRoots )
+    {
+        this.originalInterpolatedTestCompileSourceRoots = originalInterpolatedTestCompileSourceRoots;
+    }
+
+    protected void setDynamicScriptSourceRoots( List dynamicScriptSourceRoots )
+    {
+        this.dynamicScriptSourceRoots = dynamicScriptSourceRoots;
+    }
+
+    protected void setOriginalInterpolatedScriptSourceRoots( List originalInterpolatedScriptSourceRoots )
+    {
+        this.originalInterpolatedScriptSourceRoots = originalInterpolatedScriptSourceRoots;
+    }
+
 }

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/MavenProjectBuilder.java Fri Jun  6 14:50:53 2008
@@ -24,6 +24,7 @@
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.profiles.ProfileManager;
+import org.apache.maven.project.interpolation.ModelInterpolationException;
 import org.apache.maven.wagon.events.TransferListener;
 
 import java.io.File;
@@ -113,4 +114,14 @@
                         ProjectBuilderConfiguration config,
                         boolean checkDistributionManagementStatus )
         throws ProjectBuildingException;
+
+ // ----------------------------------------------------------------------------
+ // API BELOW IS USED TO PRESERVE DYNAMISM IN THE BUILD SECTION OF THE POM.
+ // ----------------------------------------------------------------------------
+
+    void calculateConcreteState( MavenProject project, ProjectBuilderConfiguration config )
+        throws ModelInterpolationException;
+
+    void restoreDynamicState( MavenProject project, ProjectBuilderConfiguration config )
+        throws ModelInterpolationException;
 }

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/ModelUtils.java Fri Jun  6 14:50:53 2008
@@ -581,6 +581,17 @@
         return newModel;
     }
 
+    public static Build cloneBuild( Build build )
+    {
+        ModelInheritanceAssembler assembler = new DefaultModelInheritanceAssembler();
+
+        Build clone = new Build();
+
+        assembler.assembleBuildInheritance( clone, build );
+
+        return clone;
+    }
+
     private static List cloneProfiles( List profiles )
     {
         if ( profiles == null )

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java Fri Jun  6 14:50:53 2008
@@ -289,83 +289,89 @@
                 child.setBuild( childBuild );
             }
 
-            // The build has been set but we want to step in here and fill in
-            // values that have not been set by the child.
+            assembleBuildInheritance( childBuild, parentBuild );
+        }
+    }
 
-            if ( childBuild.getSourceDirectory() == null )
-            {
-                childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
-            }
+    public void assembleBuildInheritance( Build childBuild,
+                                           Build parentBuild )
+    {
+        // The build has been set but we want to step in here and fill in
+        // values that have not been set by the child.
 
-            if ( childBuild.getScriptSourceDirectory() == null )
-            {
-                childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
-            }
+        if ( childBuild.getSourceDirectory() == null )
+        {
+            childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
+        }
 
-            if ( childBuild.getTestSourceDirectory() == null )
-            {
-                childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
-            }
+        if ( childBuild.getScriptSourceDirectory() == null )
+        {
+            childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
+        }
 
-            if ( childBuild.getOutputDirectory() == null )
-            {
-                childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
-            }
+        if ( childBuild.getTestSourceDirectory() == null )
+        {
+            childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
+        }
 
-            if ( childBuild.getTestOutputDirectory() == null )
-            {
-                childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
-            }
+        if ( childBuild.getOutputDirectory() == null )
+        {
+            childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
+        }
 
-            // Extensions are accumlated
-            ModelUtils.mergeExtensionLists( childBuild, parentBuild );
+        if ( childBuild.getTestOutputDirectory() == null )
+        {
+            childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
+        }
 
-            if ( childBuild.getDirectory() == null )
-            {
-                childBuild.setDirectory( parentBuild.getDirectory() );
-            }
+        // Extensions are accumlated
+        ModelUtils.mergeExtensionLists( childBuild, parentBuild );
 
-            if ( childBuild.getDefaultGoal() == null )
-            {
-                childBuild.setDefaultGoal( parentBuild.getDefaultGoal() );
-            }
+        if ( childBuild.getDirectory() == null )
+        {
+            childBuild.setDirectory( parentBuild.getDirectory() );
+        }
 
-            if ( childBuild.getFinalName() == null )
-            {
-                childBuild.setFinalName( parentBuild.getFinalName() );
-            }
+        if ( childBuild.getDefaultGoal() == null )
+        {
+            childBuild.setDefaultGoal( parentBuild.getDefaultGoal() );
+        }
 
-            ModelUtils.mergeFilterLists( childBuild.getFilters(), parentBuild.getFilters() );
+        if ( childBuild.getFinalName() == null )
+        {
+            childBuild.setFinalName( parentBuild.getFinalName() );
+        }
 
-            List resources = childBuild.getResources();
-            if ( ( resources == null ) || resources.isEmpty() )
-            {
-                childBuild.setResources( parentBuild.getResources() );
-            }
+        ModelUtils.mergeFilterLists( childBuild.getFilters(), parentBuild.getFilters() );
 
-            resources = childBuild.getTestResources();
-            if ( ( resources == null ) || resources.isEmpty() )
-            {
-                childBuild.setTestResources( parentBuild.getTestResources() );
-            }
+        List resources = childBuild.getResources();
+        if ( ( resources == null ) || resources.isEmpty() )
+        {
+            childBuild.setResources( parentBuild.getResources() );
+        }
 
-            // Plugins are aggregated if Plugin.inherit != false
-            ModelUtils.mergePluginLists( childBuild, parentBuild, true );
+        resources = childBuild.getTestResources();
+        if ( ( resources == null ) || resources.isEmpty() )
+        {
+            childBuild.setTestResources( parentBuild.getTestResources() );
+        }
 
-            // Plugin management :: aggregate
-            PluginManagement dominantPM = childBuild.getPluginManagement();
-            PluginManagement recessivePM = parentBuild.getPluginManagement();
+        // Plugins are aggregated if Plugin.inherit != false
+        ModelUtils.mergePluginLists( childBuild, parentBuild, true );
 
-            if ( ( dominantPM == null ) && ( recessivePM != null ) )
-            {
-                // FIXME: Filter out the inherited == false stuff!
-                childBuild.setPluginManagement( recessivePM );
-            }
-            else
-            {
-                ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(),
-                                             false );
-            }
+        // Plugin management :: aggregate
+        PluginManagement dominantPM = childBuild.getPluginManagement();
+        PluginManagement recessivePM = parentBuild.getPluginManagement();
+
+        if ( ( dominantPM == null ) && ( recessivePM != null ) )
+        {
+            // FIXME: Filter out the inherited == false stuff!
+            childBuild.setPluginManagement( recessivePM );
+        }
+        else
+        {
+            ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(),
+                                         false );
         }
     }
 

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/main/java/org/apache/maven/project/inheritance/ModelInheritanceAssembler.java Fri Jun  6 14:50:53 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
 
 /**
@@ -33,5 +34,8 @@
 
     void assembleModelInheritance( Model child, Model parent );
 
+    public void assembleBuildInheritance( Build childBuild,
+                                          Build parentBuild );
+
     void copyModel( Model dest, Model source );
 }

Modified: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java?rev=664147&r1=664146&r2=664147&view=diff
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java (original)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java Fri Jun  6 14:50:53 2008
@@ -180,6 +180,7 @@
          File pom = getTestFile( "src/test/resources/projects/build-path-expression-pom.xml" );
 
          MavenProject project = getProject( pom );
+         projectBuilder.calculateConcreteState( project, new DefaultProjectBuilderConfiguration() );
 
          Build build = project.getBuild();
          assertNotNull( "Project should have a build section containing the test resource.", build );

Added: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java?rev=664147&view=auto
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java (added)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java Fri Jun  6 14:50:53 2008
@@ -0,0 +1,595 @@
+package org.apache.maven.project;
+
+import org.apache.maven.model.Build;
+import org.apache.maven.model.Resource;
+import org.apache.maven.project.interpolation.ModelInterpolationException;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+public class MavenProjectDynamismTest
+    extends PlexusTestCase
+{
+
+    private MavenProjectBuilder projectBuilder;
+
+    public void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.class.getName() );
+    }
+
+    public void testRoundTrip()
+        throws IOException, XmlPullParserException, URISyntaxException,
+        ModelInterpolationException, ProjectBuildingException
+    {
+        MavenProject project = buildProject( "pom.xml" );
+
+        File basedir = project.getBasedir();
+        File buildDir = new File( basedir, "target" );
+
+        String basedirExpr = "${pom.basedir}";
+        String buildDirExpr = "${pom.build.directory}";
+
+        // --------------------------------------------------------------------
+        // FIRST, VERIFY THE INITIAL STATE FOR THE BUILD SECTION AND
+        // ASSOCIATED DIRECTORIES ATTACHED TO THE PROJECT INSTANCE.
+        // --------------------------------------------------------------------
+
+        Build build = project.getBuild();
+
+        assertEquals( "Original source directory should be expressed in terms of the basedir.",
+                      basedirExpr + "/src/main/java",
+                      build.getSourceDirectory() );
+
+        assertEquals( "Original test-source directory should be expressed in terms of the basedir.",
+                      basedirExpr + "/src/test/java",
+                      build.getTestSourceDirectory() );
+
+        assertEquals( "Original script-source directory should be expressed in terms of the basedir.",
+                      basedirExpr + "/src/main/scripts",
+                      build.getScriptSourceDirectory() );
+
+        List compileSourceRoots = project.getCompileSourceRoots();
+
+        assertNotNull( "Original compile-source roots should not be null.", compileSourceRoots );
+
+        assertEquals( "Original compile-source roots should contain one entry.",
+                      1,
+                      compileSourceRoots.size() );
+
+        assertEquals( "Original compile-source roots should contain uninterpolated source-directory value.",
+                      basedirExpr + "/src/main/java",
+                      compileSourceRoots.get( 0 ) );
+
+        List testCompileSourceRoots = project.getTestCompileSourceRoots();
+
+        assertNotNull( "Original test-compile-source roots should not be null.",
+                       testCompileSourceRoots );
+
+        assertEquals( "Original test-compile-source roots should contain one entry.",
+                      1,
+                      testCompileSourceRoots.size() );
+
+        assertEquals( "Original test-compile-source roots should contain uninterpolated test-source-directory value.",
+                      basedirExpr + "/src/test/java",
+                      testCompileSourceRoots.get( 0 ) );
+
+        List scriptSourceRoots = project.getScriptSourceRoots();
+
+        assertNotNull( "Original script-source roots should not be null.", scriptSourceRoots );
+
+        assertEquals( "Original script-source roots should contain one entry.",
+                      1,
+                      scriptSourceRoots.size() );
+
+        assertEquals( "Original script-source roots should contain uninterpolated script-source-directory value.",
+                      basedirExpr + "/src/main/scripts",
+                      scriptSourceRoots.get( 0 ) );
+
+        List resources = build.getResources();
+
+        assertNotNull( "Original resources should not be null.", resources );
+
+        assertEquals( "Original resources should contain one entry.", 1, resources.size() );
+
+        assertEquals( "Original resource should contain uninterpolated reference to build directory.",
+                      buildDirExpr + "/generated-resources/plexus",
+                      ( (Resource) resources.get( 0 ) ).getDirectory() );
+
+        List filters = build.getFilters();
+
+        assertNotNull( "Original filters should not be null.", filters );
+
+        assertEquals( "Original filters should contain one entry.", 1, filters.size() );
+
+        assertEquals( "Original filter entry should contain uninterpolated reference to build directory.",
+                      buildDirExpr + "/generated-filters.properties",
+                      filters.get( 0 ) );
+
+        assertEquals( "Original output-directory should be expressed in terms of the build-directory.",
+                      buildDirExpr + "/classes",
+                      build.getOutputDirectory() );
+
+        assertEquals( "Original test-output-directory should be expressed in terms of the build-directory.",
+                      buildDirExpr + "/test-classes",
+                      build.getTestOutputDirectory() );
+
+        assertEquals( "Original build directory should be relative.",
+                      "target",
+                      build.getDirectory() );
+
+        // --------------------------------------------------------------------
+        // NOW, CALCULATE THE CONCRETE STATE FOR THE BUILD SECTION AND
+        // ASSOCIATED DIRECTORIES ATTACHED TO THE PROJECT INSTANCE.
+        // --------------------------------------------------------------------
+
+        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
+
+        projectBuilder.calculateConcreteState( project, config );
+
+        assertTrue( project.isConcrete() );
+
+        build = project.getBuild();
+
+        assertEquals( "Concrete source directory should be absolute.",
+                      new File( basedir, "/src/main/java" ).getAbsolutePath(),
+                      build.getSourceDirectory() );
+
+        assertEquals( "Concrete test-source directory should be absolute.",
+                      new File( basedir, "/src/test/java" ).getAbsolutePath(),
+                      build.getTestSourceDirectory() );
+
+        assertEquals( "Concrete script-source directory should be absolute.",
+                      new File( basedir, "/src/main/scripts" ).getAbsolutePath(),
+                      build.getScriptSourceDirectory() );
+
+        compileSourceRoots = project.getCompileSourceRoots();
+
+        assertNotNull( "Concrete compile-source roots should not be null.", compileSourceRoots );
+
+        assertEquals( "Concrete compile-source roots should contain one entry.",
+                      1,
+                      compileSourceRoots.size() );
+
+        assertEquals( "Concrete compile-source roots should contain interpolated source-directory value.",
+                      new File( basedir, "/src/main/java" ).getAbsolutePath(),
+                      compileSourceRoots.get( 0 ) );
+
+        testCompileSourceRoots = project.getTestCompileSourceRoots();
+
+        assertNotNull( "Concrete test-compile-source roots should not be null.",
+                       testCompileSourceRoots );
+
+        assertEquals( "Concrete test-compile-source roots should contain one entry.",
+                      1,
+                      testCompileSourceRoots.size() );
+
+        assertEquals( "Concrete test-compile-source roots should contain interpolated test-source-directory value.",
+                      new File( basedir, "/src/test/java" ).getAbsolutePath(),
+                      testCompileSourceRoots.get( 0 ) );
+
+        scriptSourceRoots = project.getScriptSourceRoots();
+
+        assertNotNull( "Concrete script-source roots should not be null.", scriptSourceRoots );
+
+        assertEquals( "Concrete script-source roots should contain one entry.",
+                      1,
+                      scriptSourceRoots.size() );
+
+        assertEquals( "Concrete script-source roots should contain interpolated script-source-directory value.",
+                      new File( basedir, "/src/main/scripts" ).getAbsolutePath(),
+                      scriptSourceRoots.get( 0 ) );
+
+        resources = build.getResources();
+
+        assertNotNull( "Concrete resources should not be null.", resources );
+
+        assertEquals( "Concrete resources should contain one entry.", 1, resources.size() );
+
+        assertEquals( "Concrete resource should contain absolute path.",
+                      new File( buildDir, "generated-resources/plexus" ).getAbsolutePath(),
+                      ( (Resource) resources.get( 0 ) ).getDirectory() );
+
+        filters = build.getFilters();
+
+        assertNotNull( "Concrete filters should not be null.", filters );
+
+        assertEquals( "Concrete filters should contain one entry.", 1, filters.size() );
+
+        assertEquals( "Concrete filter entry should contain absolute path.",
+                      new File( buildDir, "/generated-filters.properties" ).getAbsolutePath(),
+                      filters.get( 0 ) );
+
+        assertEquals( "Concrete output-directory should be absolute.",
+                      new File( buildDir, "/classes" ).getAbsolutePath(),
+                      build.getOutputDirectory() );
+
+        assertEquals( "Concrete test-output-directory should be absolute.",
+                      new File( buildDir, "/test-classes" ).getAbsolutePath(),
+                      build.getTestOutputDirectory() );
+
+        assertEquals( "Concrete build directory should be absolute.",
+                      new File( basedir, "target" ).getAbsolutePath(),
+                      build.getDirectory() );
+
+        // --------------------------------------------------------------------
+        // NOW, RESTORE THE DYNAMIC STATE FOR THE BUILD SECTION AND
+        // ASSOCIATED DIRECTORIES ATTACHED TO THE PROJECT INSTANCE.
+        // --------------------------------------------------------------------
+
+        projectBuilder.restoreDynamicState( project, config );
+
+        assertFalse( project.isConcrete() );
+
+        build = project.getBuild();
+
+        assertEquals( "Restored source directory should be expressed in terms of the basedir.",
+                      basedirExpr + "/src/main/java",
+                      build.getSourceDirectory() );
+
+        assertEquals( "Restored test-source directory should be expressed in terms of the basedir.",
+                      basedirExpr + "/src/test/java",
+                      build.getTestSourceDirectory() );
+
+        assertEquals( "Restored script-source directory should be expressed in terms of the basedir.",
+                      basedirExpr + "/src/main/scripts",
+                      build.getScriptSourceDirectory() );
+
+        compileSourceRoots = project.getCompileSourceRoots();
+
+        assertNotNull( "Restored compile-source roots should not be null.", compileSourceRoots );
+
+        assertEquals( "Restored compile-source roots should contain one entry.",
+                      1,
+                      compileSourceRoots.size() );
+
+        assertEquals( "Restored compile-source roots should contain uninterpolated source-directory value.",
+                      basedirExpr + "/src/main/java",
+                      compileSourceRoots.get( 0 ) );
+
+        testCompileSourceRoots = project.getTestCompileSourceRoots();
+
+        assertNotNull( "Restored test-compile-source roots should not be null.",
+                       testCompileSourceRoots );
+
+        assertEquals( "Restored test-compile-source roots should contain one entry.",
+                      1,
+                      testCompileSourceRoots.size() );
+
+        assertEquals( "Restored test-compile-source roots should contain uninterpolated test-source-directory value.",
+                      basedirExpr + "/src/test/java",
+                      testCompileSourceRoots.get( 0 ) );
+
+        scriptSourceRoots = project.getScriptSourceRoots();
+
+        assertNotNull( "Restored script-source roots should not be null.", scriptSourceRoots );
+
+        assertEquals( "Restored script-source roots should contain one entry.",
+                      1,
+                      scriptSourceRoots.size() );
+
+        assertEquals( "Restored script-source roots should contain uninterpolated script-source-directory value.",
+                      basedirExpr + "/src/main/scripts",
+                      scriptSourceRoots.get( 0 ) );
+
+        resources = build.getResources();
+
+        assertNotNull( "Restored resources should not be null.", resources );
+
+        assertEquals( "Restored resources should contain one entry.", 1, resources.size() );
+
+        assertEquals( "Restored resource should contain uninterpolated reference to build directory.",
+                      buildDirExpr + "/generated-resources/plexus",
+                      ( (Resource) resources.get( 0 ) ).getDirectory() );
+
+        filters = build.getFilters();
+
+        assertNotNull( "Restored filters should not be null.", filters );
+
+        assertEquals( "Restored filters should contain one entry.", 1, filters.size() );
+
+        assertEquals( "Restored filter entry should contain uninterpolated reference to build directory.",
+                      buildDirExpr + "/generated-filters.properties",
+                      filters.get( 0 ) );
+
+        assertEquals( "Restored output-directory should be expressed in terms of the build-directory.",
+                      buildDirExpr + "/classes",
+                      build.getOutputDirectory() );
+
+        assertEquals( "Restored test-output-directory should be expressed in terms of the build-directory.",
+                      buildDirExpr + "/test-classes",
+                      build.getTestOutputDirectory() );
+
+        assertEquals( "Restored build directory should be relative.",
+                      "target",
+                      build.getDirectory() );
+    }
+
+    public void testShouldPreserveAddedResourceInRestoredState()
+        throws IOException, XmlPullParserException, URISyntaxException, ProjectBuildingException,
+        ModelInterpolationException
+    {
+        MavenProject project = buildProject( "pom.xml" );
+
+        Build build = project.getBuild();
+
+        List resources = build.getResources();
+        assertNotNull( "Original resources should not be null.", resources );
+        assertEquals( "Original resources should contain only one entry.", 1, resources.size() );
+        assertResourcePresent( "original resources",
+                               "${pom.build.directory}/generated-resources/plexus",
+                               resources );
+
+        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
+
+        projectBuilder.calculateConcreteState( project, config );
+
+        build = project.getBuild();
+
+        Resource r = new Resource();
+        r.setDirectory( "myDir" );
+
+        build.addResource( r );
+
+        resources = build.getResources();
+        assertNotNull( "Concrete resources should not be null.", resources );
+        assertEquals( "Concrete resources should contain two entries.", 2, resources.size() );
+        assertResourcePresent( "concrete resources",
+                               new File( build.getDirectory(), "generated-resources/plexus" ).getAbsolutePath(),
+                               resources );
+        assertResourcePresent( "concrete resources", "myDir", resources );
+
+        projectBuilder.restoreDynamicState( project, config );
+
+        build = project.getBuild();
+
+        resources = build.getResources();
+        assertNotNull( "Restored resources should not be null.", resources );
+        assertEquals( "Restored resources should contain two entries.", 2, resources.size() );
+        assertResourcePresent( "restored resources",
+                               "${pom.build.directory}/generated-resources/plexus",
+                               resources );
+        assertResourcePresent( "restored resources", "myDir", resources );
+    }
+
+    public void testShouldPreserveAddedFilterInRestoredState()
+        throws IOException, XmlPullParserException, URISyntaxException, ProjectBuildingException,
+        ModelInterpolationException
+    {
+        MavenProject project = buildProject( "pom.xml" );
+
+        Build build = project.getBuild();
+
+        List filters = build.getFilters();
+        assertNotNull( "Original filters should not be null.", filters );
+        assertEquals( "Original filters should contain only one entry.", 1, filters.size() );
+        assertFilterPresent( "original filters",
+                             "${pom.build.directory}/generated-filters.properties",
+                             filters );
+
+        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
+
+        projectBuilder.calculateConcreteState( project, config );
+
+        build = project.getBuild();
+
+        build.addFilter( "myDir/filters.properties" );
+
+        filters = build.getFilters();
+        assertNotNull( "Concrete filters should not be null.", filters );
+        assertEquals( "Concrete filters should contain two entries.", 2, filters.size() );
+        assertFilterPresent( "concrete filters",
+                             new File( build.getDirectory(), "generated-filters.properties" ).getAbsolutePath(),
+                             filters );
+
+        assertFilterPresent( "concrete filters", "myDir/filters.properties", filters );
+
+        projectBuilder.restoreDynamicState( project, config );
+
+        build = project.getBuild();
+
+        filters = build.getFilters();
+        assertNotNull( "Restored filters should not be null.", filters );
+        assertEquals( "Restored filters should contain two entries.", 2, filters.size() );
+        assertFilterPresent( "restored filters",
+                             "${pom.build.directory}/generated-filters.properties",
+                             filters );
+        assertFilterPresent( "restored filters", "myDir/filters.properties", filters );
+    }
+
+    public void testShouldIncorporateChangedBuildDirectoryViaExpressionsOnNextConcreteCalculation()
+        throws IOException, XmlPullParserException, URISyntaxException, ProjectBuildingException,
+        ModelInterpolationException
+    {
+        MavenProject project = buildProject( "pom.xml" );
+
+        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
+
+        projectBuilder.calculateConcreteState( project, config );
+
+        Build build = project.getBuild();
+
+        assertEquals( "First concrete build directory should be absolute and point to target dir.",
+                      new File( project.getBasedir(), "target" ).getAbsolutePath(),
+                      build.getDirectory() );
+        assertEquals( "First concrete build output-directory should be absolute and point to target/classes dir.",
+                      new File( project.getBasedir(), "target/classes" ).getAbsolutePath(),
+                      build.getOutputDirectory() );
+
+        build.setDirectory( "target2" );
+
+        assertEquals( "AFTER CHANGING BUILD DIRECTORY, build directory should be relative and point to target2 dir.",
+                      "target2",
+                      build.getDirectory() );
+        assertEquals( "AFTER CHANGING BUILD DIRECTORY, build output-directory should be absolute and still point to target/classes dir.",
+                      new File( project.getBasedir(), "target/classes" ).getAbsolutePath(),
+                      build.getOutputDirectory() );
+
+        projectBuilder.restoreDynamicState( project, config );
+        projectBuilder.calculateConcreteState( project, config );
+
+        build = project.getBuild();
+
+        assertEquals( "Second concrete build directory should be absolute and point to target2 dir.",
+                      new File( project.getBasedir(), "target2" ).getAbsolutePath(),
+                      build.getDirectory() );
+        assertEquals( "Second concrete build output-directory should be absolute and point to target2/classes dir.",
+                      new File( project.getBasedir(), "target2/classes" ).getAbsolutePath(),
+                      build.getOutputDirectory() );
+    }
+
+    public void testShouldPreserveInitialValuesForPropertiesReferencingBuildPaths()
+        throws IOException, XmlPullParserException, URISyntaxException, ProjectBuildingException,
+        ModelInterpolationException
+    {
+        MavenProject project = buildProject( "pom.xml" );
+
+        String buildDir = new File( project.getBasedir(), project.getBuild().getDirectory() ).getAbsolutePath();
+        Properties props = project.getProperties();
+
+        assertEquals( "Original property value for 'myProperty' should be the absolute initial build directory.",
+                      buildDir,
+                      props.getProperty( "myProperty" ) );
+
+        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
+        projectBuilder.calculateConcreteState( project, config );
+
+        project.getBuild().setDirectory( "target2" );
+
+        projectBuilder.restoreDynamicState( project, config );
+        projectBuilder.calculateConcreteState( project, config );
+
+        assertEquals( "After resetting build-directory and going through a recalculation phase for the project, "
+                                      + "property value for 'myProperty' should STILL be the absolute initial build directory.",
+                      buildDir,
+                      props.getProperty( "myProperty" ) );
+    }
+
+    public void testShouldAlignCompileSourceRootsInConcreteState()
+        throws IOException, XmlPullParserException, URISyntaxException, ProjectBuildingException,
+        ModelInterpolationException
+    {
+        MavenProject project = buildProject( "pom-relative.xml" );
+
+        List compileSourceRoots = project.getCompileSourceRoots();
+        assertNotNull( "Original dynamic state compile-source roots should not be null.", compileSourceRoots );
+        assertEquals( "Original dynamic state should contain one compile-source root.", 1, compileSourceRoots.size() );
+        assertEquals( "Original dynamic state should have a relative path for compile-source root.", "src/main/java", compileSourceRoots.get( 0 ) );
+
+        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
+        projectBuilder.calculateConcreteState( project, config );
+
+        compileSourceRoots = project.getCompileSourceRoots();
+        assertNotNull( "First concrete state compile-source roots should not be null.", compileSourceRoots );
+        assertEquals( "First concrete state should contain one compile-source root.", 1, compileSourceRoots.size() );
+        assertEquals( "First concrete state should have an absolute path for compile-source root.", new File( project.getBasedir(), "src/main/java" ).getAbsolutePath(), compileSourceRoots.get( 0 ) );
+
+        String newSourceRoot = new File( project.getBuild().getDirectory(), "generated-sources/modello" ).getAbsolutePath();
+
+        project.addCompileSourceRoot( newSourceRoot );
+
+        projectBuilder.restoreDynamicState( project, config );
+
+        compileSourceRoots = project.getCompileSourceRoots();
+        assertNotNull( "Restored dynamic state compile-source roots should not be null.", compileSourceRoots );
+        assertEquals( "Restored dynamic state should contain two compile-source roots.", 2, compileSourceRoots.size() );
+        assertEquals( "Restored dynamic state should have a relative path for original compile-source root.", "src/main/java", compileSourceRoots.get( 0 ) );
+        assertEquals( "Restored dynamic state should have a relative path for new compile-source root.", "target/generated-sources/modello", compileSourceRoots.get( 1 ) );
+
+        projectBuilder.calculateConcreteState( project, config );
+
+        compileSourceRoots = project.getCompileSourceRoots();
+        assertNotNull( "Second concrete state compile-source roots should not be null.", compileSourceRoots );
+        assertEquals( "Second concrete state should contain two compile-source roots.", 2, compileSourceRoots.size() );
+        assertEquals( "Second concrete state should have an absolute path for original compile-source root.", new File( project.getBasedir(), "src/main/java" ).getAbsolutePath(), compileSourceRoots.get( 0 ) );
+        assertEquals( "Second concrete state should have an absolute path for new compile-source root.", newSourceRoot, compileSourceRoots.get( 1 ) );
+    }
+
+    // Useful for diagnostics.
+//    private void displayPOM( Model model )
+//        throws IOException
+//    {
+//        StringWriter writer = new StringWriter();
+//        new MavenXpp3Writer().write( writer, model );
+//
+//        System.out.println( writer.toString() );
+//    }
+
+    private void assertResourcePresent( String testLabel,
+                                        String directory,
+                                        List resources )
+    {
+        boolean found = false;
+
+        if ( resources != null )
+        {
+            for ( Iterator it = resources.iterator(); it.hasNext(); )
+            {
+                Resource resource = (Resource) it.next();
+                if ( directory.equals( resource.getDirectory() ) )
+                {
+                    found = true;
+                    break;
+                }
+            }
+        }
+
+        if ( !found )
+        {
+            fail( "Missing resource with directory: " + directory + " in " + testLabel );
+        }
+    }
+
+    private void assertFilterPresent( String testLabel,
+                                      String path,
+                                      List filters )
+    {
+        boolean found = false;
+
+        if ( filters != null )
+        {
+            for ( Iterator it = filters.iterator(); it.hasNext(); )
+            {
+                String filterPath = (String) it.next();
+                if ( path.equals( filterPath ) )
+                {
+                    found = true;
+                    break;
+                }
+            }
+        }
+
+        if ( !found )
+        {
+            fail( "Missing filter with path: " + path + " in " + testLabel );
+        }
+    }
+
+    private MavenProject buildProject( String path )
+        throws IOException, XmlPullParserException, URISyntaxException, ProjectBuildingException
+    {
+        ClassLoader cloader = Thread.currentThread().getContextClassLoader();
+        URL resource = cloader.getResource( "project-dynamism/" + path );
+
+        if ( resource == null )
+        {
+            fail( "Cannot find classpath resource for POM: " + path );
+        }
+
+        File pomFile = new File( resource.toURI().normalize().getPath() );
+        pomFile = pomFile.getAbsoluteFile();
+
+        return projectBuilder.build( pomFile, new DefaultProjectBuilderConfiguration() );
+    }
+
+}

Propchange: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/java/org/apache/maven/project/MavenProjectDynamismTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom-relative.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom-relative.xml?rev=664147&view=auto
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom-relative.xml (added)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom-relative.xml Fri Jun  6 14:50:53 2008
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" 
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+         
+  <modelVersion>4.0.0</modelVersion>
+  
+  <groupId>org.test</groupId>
+  <artifactId>test-build-dynamism</artifactId>
+  <version>1</version>
+  
+  <properties>
+    <myProperty>${pom.build.directory}</myProperty>
+  </properties>
+
+  <build>
+    <resources>
+      <resource>
+        <directory>${pom.build.directory}/generated-resources/plexus</directory>
+      </resource>
+    </resources>
+    
+    <filters>
+      <filter>${pom.build.directory}/generated-filters.properties</filter>
+    </filters>
+    
+    <directory>target</directory>
+    
+    <sourceDirectory>src/main/java</sourceDirectory>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
+    
+    <outputDirectory>${pom.build.directory}/classes</outputDirectory>
+    <testOutputDirectory>${pom.build.directory}/test-classes</testOutputDirectory>
+  </build>
+
+</project>
\ No newline at end of file

Propchange: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom-relative.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom-relative.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom.xml?rev=664147&view=auto
==============================================================================
--- maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom.xml (added)
+++ maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom.xml Fri Jun  6 14:50:53 2008
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" 
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+         
+  <modelVersion>4.0.0</modelVersion>
+  
+  <groupId>org.test</groupId>
+  <artifactId>test-build-dynamism</artifactId>
+  <version>1</version>
+  
+  <properties>
+    <myProperty>${pom.build.directory}</myProperty>
+  </properties>
+
+  <build>
+    <resources>
+      <resource>
+        <directory>${pom.build.directory}/generated-resources/plexus</directory>
+      </resource>
+    </resources>
+    
+    <filters>
+      <filter>${pom.build.directory}/generated-filters.properties</filter>
+    </filters>
+    
+    <directory>target</directory>
+    
+    <sourceDirectory>${pom.basedir}/src/main/java</sourceDirectory>
+    <testSourceDirectory>${pom.basedir}/src/test/java</testSourceDirectory>
+    <scriptSourceDirectory>${pom.basedir}/src/main/scripts</scriptSourceDirectory>
+    
+    <outputDirectory>${pom.build.directory}/classes</outputDirectory>
+    <testOutputDirectory>${pom.build.directory}/test-classes</testOutputDirectory>
+  </build>
+
+</project>
\ No newline at end of file

Propchange: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/branches/john-2.0.x-dynamicBuild/maven-project/src/test/resources/project-dynamism/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"