From 3caaba53ed8fc3caf1f02c4d0160e6a042e79b9f Mon Sep 17 00:00:00 2001 From: Britton Isbell Date: Thu, 18 Sep 2008 17:02:55 +0000 Subject: [PATCH] Fix: If the child pom found a parent pom within a local build, where the child pom project/parent/groupId[artifactId] did not match the groupId[artifactId] of the parent pom, then it would exclude the parent pom from inheritance. Now it will attempt to locate the parent pom in the local repo. If the parent pom is not found in local repo, build will fail. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@696713 13f79535-47bb-0310-9956-ffa450edef68 --- .../project/builder/impl/DefaultProjectBuilder.java | 9 +++++++++ pom.xml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java index 56f35f06fc..be532dcf94 100644 --- a/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java @@ -310,6 +310,15 @@ public final class DefaultProjectBuilder logger.warn( "Parent pom ids do not match: Parent File = " + parentFile.getAbsolutePath() + ", Parent ID = " + parentDomainModel.getId() + ", Child ID = " + domainModel.getId() + ", Expected Parent ID = " + domainModel.getModel().getParent().getId() ); + List parentDomainModels = getDomainModelParentsFromRepository( domainModel, artifactResolver ); + if(parentDomainModels.size() == 0) + { + throw new IOException("Unable to find parent pom on local path or repo: " + + domainModel.getModel().getParent().getId()); + } + logger.info("Attempting to lookup from the repository: Found parents: " + parentDomainModels.size()); + domainModels.addAll( parentDomainModels ); + return domainModels; } domainModels.add( parentDomainModel ); diff --git a/pom.xml b/pom.xml index 2b7f5252ae..089636aea3 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ org.apache.maven maven-parent - 9-SNAPSHOT + 10-SNAPSHOT ../pom/maven/pom.xml 4.0.0