o we don't need to run processProjectLogic on the super pom but we do need to make sure the plugin repositories are populated

for plugins like archetype which have no POM to start with but need repositories.


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@573736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2007-09-07 22:29:34 +00:00
parent d72b8bc88a
commit a05e9f9884
3 changed files with 54 additions and 7 deletions

View File

@ -294,7 +294,6 @@ public class DefaultMaven
files,
request.getLocalRepository(),
request.isRecursive(),
request.getSettings(),
request.getProfileManager(),
!request.useReactor() );
@ -323,7 +322,6 @@ public class DefaultMaven
private List collectProjects( List files,
ArtifactRepository localRepository,
boolean recursive,
Settings settings,
ProfileManager globalProfileManager,
boolean isRoot )
throws ArtifactResolutionException, ProjectBuildingException, ProfileActivationException,
@ -425,7 +423,6 @@ public class DefaultMaven
moduleFiles,
localRepository,
recursive,
settings,
globalProfileManager,
false );
projects.addAll( collectedProjects );

View File

@ -269,6 +269,8 @@ public class DefaultMavenProjectBuilder
try
{
superProject.setRemoteArtifactRepositories( mavenTools.buildArtifactRepositories( superModel.getRepositories() ) );
superProject.setPluginArtifactRepositories( mavenTools.buildArtifactRepositories( superModel.getRepositories() ) );
}
catch ( InvalidRepositoryException e )
{
@ -974,6 +976,7 @@ public class DefaultMavenProjectBuilder
project.setPluginArtifactRepositories( mavenTools.buildArtifactRepositories( model.getPluginRepositories() ) );
DistributionManagement dm = model.getDistributionManagement();
if ( dm != null )
{
ArtifactRepository repo = mavenTools.buildDeploymentArtifactRepository( dm.getRepository() );
@ -990,10 +993,6 @@ public class DefaultMavenProjectBuilder
if ( parentProject != null )
{
// Artifact parentArtifact = artifactFactory.createParentArtifact( parentProject.getGroupId(),
// parentProject.getArtifactId(),
// parentProject.getVersion() );
// the parent artifact from the parameter passed project instance is resolved.
project.setParentArtifact( parentArtifact );
}

View File

@ -0,0 +1,51 @@
package org.apache.maven.project;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class SuperPomProjectBuilderTest
extends AbstractMavenProjectTestCase
{
public void setUp()
throws Exception
{
super.setUp();
projectBuilder = (DefaultMavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );
}
public void testBuildFromMiddlePom() throws Exception
{
MavenProject project = projectBuilder.buildStandaloneSuperProject();
assertNotNull( project.getRemoteArtifactRepositories() );
assertNotNull( project.getPluginArtifactRepositories() );
}
}