[MNG-2054] make it0096 test the problem properly by going to enough depth. Rollback the "fix" for MNG-2130 as it didn't appear to be correct - it caused it0096, and it0099 passes anyway. I suspect there were other circumstances in the codebase causing 99 to fail at the time. You should not use a cached project for inheritence - it will accumulate inherited elements as was the case with MNG-2054.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@390133 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2006-03-30 13:54:30 +00:00
parent 32d8679253
commit 1c23ee16a4
4 changed files with 6 additions and 20 deletions

View File

@ -2,11 +2,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<groupId>org.apache.maven.it0096</groupId> <groupId>org.apache.maven.it0096</groupId>
<artifactId>maven-it0096-project-level2</artifactId> <artifactId>maven-it0096-project-level3</artifactId>
<version>1</version> <version>1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>maven-it0096-project-level3</artifactId> <artifactId>maven-it0096-project-jar</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>

View File

@ -1005,22 +1005,10 @@ public class DefaultMavenProjectBuilder
throw new ProjectBuildingException( projectId, "Missing version element from parent element" ); 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... // the only way this will have a value is if we find the parent on disk...
File parentDescriptor = null; File parentDescriptor = null;
if ( parentProject != null ) model = null;
{
model = parentProject.getOriginalModel();
parentDescriptor = parentProject.getFile();
}
else
{
model = null;
}
String parentRelativePath = parentModel.getRelativePath(); String parentRelativePath = parentModel.getRelativePath();
@ -1156,16 +1144,14 @@ public class DefaultMavenProjectBuilder
{ {
parentProjectDir = parentDescriptor.getParentFile(); parentProjectDir = parentDescriptor.getParentFile();
} }
MavenProject parent = assembleLineage( model, lineage, localRepository, parentProjectDir,
parentProject = assembleLineage( model, lineage, localRepository, parentProjectDir,
parentSearchRepositories, aggregatedRemoteWagonRepositories, parentSearchRepositories, aggregatedRemoteWagonRepositories,
externalProfileManager, strict ); externalProfileManager, strict );
parentProject.setFile( parentDescriptor ); parent.setFile( parentDescriptor );
project.setParent( parentProject ); project.setParent( parent );
project.setParentArtifact( parentArtifact ); project.setParentArtifact( parentArtifact );
} }
return project; return project;