From cddc9df70e8a0798762342a828f5ea0038ed3101 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 26 Aug 2005 12:23:20 +0000 Subject: [PATCH] PR: MNG-753 add a missing need for the super repository git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@240218 13f79535-47bb-0310-9956-ffa450edef68 --- .../project/DefaultMavenProjectBuilder.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 4cfed8ae3d..66dee8aab4 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -276,8 +276,8 @@ public class DefaultMavenProjectBuilder modelCache.put( createCacheKey( model.getGroupId(), model.getArtifactId(), model.getVersion() ), model ); MavenProject project = build( projectDescriptor.getAbsolutePath(), model, localRepository, - Collections.EMPTY_LIST, projectDescriptor.getAbsoluteFile().getParentFile(), - profileManager ); + buildArtifactRepositories( getSuperModel() ), + projectDescriptor.getAbsoluteFile().getParentFile(), profileManager ); if ( project.getDistributionManagement() != null && project.getDistributionManagement().getStatus() != null ) { @@ -508,8 +508,7 @@ public class DefaultMavenProjectBuilder // only add the super repository if it wasn't overridden by a profile or project List repositories = new ArrayList( aggregatedRemoteWagonRepositories ); - List superRepositories = ProjectUtils.buildArtifactRepositories( superModel.getRepositories(), - artifactRepositoryFactory, container ); + List superRepositories = buildArtifactRepositories( superModel ); for ( Iterator i = superRepositories.iterator(); i.hasNext(); ) { ArtifactRepository repository = (ArtifactRepository) i.next(); @@ -533,6 +532,12 @@ public class DefaultMavenProjectBuilder return project; } + private List buildArtifactRepositories( Model model ) + throws ProjectBuildingException + { + return ProjectUtils.buildArtifactRepositories( model.getRepositories(), artifactRepositoryFactory, container ); + } + /** * @todo can this take in a model instead of a project and still be successful? * @todo In fact, does project REALLY need a MavenProject as a parent? Couldn't it have just a wrapper around a @@ -664,8 +669,7 @@ public class DefaultMavenProjectBuilder { if ( !model.getRepositories().isEmpty() ) { - List respositories = ProjectUtils.buildArtifactRepositories( model.getRepositories(), - artifactRepositoryFactory, container ); + List respositories = buildArtifactRepositories( model ); for ( Iterator it = respositories.iterator(); it.hasNext(); ) { @@ -1114,8 +1118,7 @@ public class DefaultMavenProjectBuilder { project.setFile( new File( ".", "pom.xml" ) ); - List remoteRepositories = ProjectUtils.buildArtifactRepositories( superModel.getRepositories(), - artifactRepositoryFactory, container ); + List remoteRepositories = buildArtifactRepositories( superModel ); project = processProjectLogic( "", project, remoteRepositories, null );