Author: jdcasey Date: Tue Mar 7 19:04:51 2006 New Revision: 384104 URL: http://svn.apache.org/viewcvs?rev=384104&view=rev Log: [MNG-2124] Re-adding the cache check for parent POMs in assembleLineage(..) when building in a multimodule scenario (if they're part of the same build, but not yet in the local repo) before checking the parent's relativePath value or hitting the repository system to look for them.
Added: maven/components/branches/maven-2.0.x/maven-core-it/it0099/ maven/components/branches/maven-2.0.x/maven-core-it/it0099/child/ maven/components/branches/maven-2.0.x/maven-core-it/it0099/child/pom.xml (with props) maven/components/branches/maven-2.0.x/maven-core-it/it0099/goals.txt (with props) maven/components/branches/maven-2.0.x/maven-core-it/it0099/pom.xml (with props) maven/components/branches/maven-2.0.x/maven-core-it/it0099/prebuild-hook.txt (with props) Modified: maven/components/branches/maven-2.0.x/maven-core-it/README.txt maven/components/branches/maven-2.0.x/maven-core-it/integration-tests.txt maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java Modified: maven/components/branches/maven-2.0.x/maven-core-it/README.txt URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-2.0.x/maven-core-it/README.txt?rev=384104&r1=384103&r2=384104&view=diff ============================================================================== --- maven/components/branches/maven-2.0.x/maven-core-it/README.txt (original) +++ maven/components/branches/maven-2.0.x/maven-core-it/README.txt Tue Mar 7 19:04:51 2006 @@ -261,6 +261,9 @@ it0098: Test that quoted system properties are processed correctly. [MNG-1415] +it0099: Test that parent-POMs cached during a build are available as parents + to other POMs in the multimodule build. [MNG-2124] + ------------------------------------------------------------------------------- - generated sources Modified: maven/components/branches/maven-2.0.x/maven-core-it/integration-tests.txt URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-2.0.x/maven-core-it/integration-tests.txt?rev=384104&r1=384103&r2=384104&view=diff ============================================================================== --- maven/components/branches/maven-2.0.x/maven-core-it/integration-tests.txt (original) +++ maven/components/branches/maven-2.0.x/maven-core-it/integration-tests.txt Tue Mar 7 19:04:51 2006 @@ -1,3 +1,4 @@ +it0099 it0098 it0097 it0096 Added: maven/components/branches/maven-2.0.x/maven-core-it/it0099/child/pom.xml URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-2.0.x/maven-core-it/it0099/child/pom.xml?rev=384104&view=auto ============================================================================== --- maven/components/branches/maven-2.0.x/maven-core-it/it0099/child/pom.xml (added) +++ maven/components/branches/maven-2.0.x/maven-core-it/it0099/child/pom.xml Tue Mar 7 19:04:51 2006 @@ -0,0 +1,9 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.maven.it0099</groupId> + <artifactId>maven-it0099-parent</artifactId> + <version>1</version> + </parent> + <artifactId>maven-it0099-child</artifactId> +</project> Propchange: maven/components/branches/maven-2.0.x/maven-core-it/it0099/child/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/components/branches/maven-2.0.x/maven-core-it/it0099/child/pom.xml ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/components/branches/maven-2.0.x/maven-core-it/it0099/goals.txt URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-2.0.x/maven-core-it/it0099/goals.txt?rev=384104&view=auto ============================================================================== --- maven/components/branches/maven-2.0.x/maven-core-it/it0099/goals.txt (added) +++ maven/components/branches/maven-2.0.x/maven-core-it/it0099/goals.txt Tue Mar 7 19:04:51 2006 @@ -0,0 +1 @@ +package Propchange: maven/components/branches/maven-2.0.x/maven-core-it/it0099/goals.txt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/components/branches/maven-2.0.x/maven-core-it/it0099/goals.txt ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/components/branches/maven-2.0.x/maven-core-it/it0099/pom.xml URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-2.0.x/maven-core-it/it0099/pom.xml?rev=384104&view=auto ============================================================================== --- maven/components/branches/maven-2.0.x/maven-core-it/it0099/pom.xml (added) +++ maven/components/branches/maven-2.0.x/maven-core-it/it0099/pom.xml Tue Mar 7 19:04:51 2006 @@ -0,0 +1,12 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.it0099</groupId> + <artifactId>maven-it0099-parent</artifactId> + <version>1</version> + + <packaging>pom</packaging> + + <modules> + <module>child</module> + </modules> +</project> Propchange: maven/components/branches/maven-2.0.x/maven-core-it/it0099/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/components/branches/maven-2.0.x/maven-core-it/it0099/pom.xml ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/components/branches/maven-2.0.x/maven-core-it/it0099/prebuild-hook.txt URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-2.0.x/maven-core-it/it0099/prebuild-hook.txt?rev=384104&view=auto ============================================================================== --- maven/components/branches/maven-2.0.x/maven-core-it/it0099/prebuild-hook.txt (added) +++ maven/components/branches/maven-2.0.x/maven-core-it/it0099/prebuild-hook.txt Tue Mar 7 19:04:51 2006 @@ -0,0 +1 @@ +rm ${artifact:org.apache.maven.it0099:maven-it0099-parent:1:pom} Propchange: maven/components/branches/maven-2.0.x/maven-core-it/it0099/prebuild-hook.txt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/components/branches/maven-2.0.x/maven-core-it/it0099/prebuild-hook.txt ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Modified: maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=384104&r1=384103&r2=384104&view=diff ============================================================================== --- maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java (original) +++ maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java Tue Mar 7 19:04:51 2006 @@ -690,10 +690,13 @@ Model previous = superProject.getModel(); +// System.out.println( "Assembling inheritance..." ); + for ( Iterator i = lineage.iterator(); i.hasNext(); ) { MavenProject currentProject = (MavenProject) i.next(); +// System.out.println( "Assembling inheritance: " + previousProject.getId() + "(" + previousProject.getName() + ")" + " <- " + currentProject.getId() + "(" + currentProject.getName() + ")" ); Model current = currentProject.getModel(); String pathAdjustment = null; @@ -711,6 +714,8 @@ previous = current; previousProject = currentProject; + +// System.out.println( "New parent project is: " + previousProject.getId() + "(" + previousProject.getName() + ")" ); } // only add the super repository if it wasn't overridden by a profile or project @@ -995,11 +1000,23 @@ throw new ProjectBuildingException( projectId, "Missing version element from parent element" ); } + String parentKey = createCacheKey( parentModel.getGroupId(), parentModel.getArtifactId(), parentModel.getVersion() ); + MavenProject parentProject = (MavenProject)projectCache.get( parentKey ); + // the only way this will have a value is if we find the parent on disk... File parentDescriptor = null; - - model = null; - + + if ( parentProject != null ) + { + model = parentProject.getOriginalModel(); + + parentDescriptor = parentProject.getFile(); + } + else + { + model = null; + } + String parentRelativePath = parentModel.getRelativePath(); // if we can't find a cached model matching the parent spec, then let's try to look on disk using @@ -1108,14 +1125,16 @@ { parentProjectDir = parentDescriptor.getParentFile(); } - MavenProject parent = assembleLineage( model, lineage, localRepository, parentProjectDir, + + parentProject = assembleLineage( model, lineage, localRepository, parentProjectDir, parentSearchRepositories, aggregatedRemoteWagonRepositories, externalProfileManager, strict ); - parent.setFile( parentDescriptor ); + parentProject.setFile( parentDescriptor ); - project.setParent( parent ); + project.setParent( parentProject ); project.setParentArtifact( parentArtifact ); + } return project;