for ( Iterator repoIterator = externalProfile.getRepositories().iterator(); repoIterator.hasNext(); )
{
Repository mavenRepo = (Repository) repoIterator.next();
ArtifactRepository artifactRepo = null;
try
{
artifactRepo =
ProjectUtils.buildArtifactRepository( mavenRepo, artifactRepositoryFactory, container );
}
catch ( InvalidRepositoryException e )
{
throw new ProjectBuildingException( projectId, e.getMessage(), e );
}
aggregatedRemoteWagonRepositories.add( artifactRepo );
}
}
MavenProject project = null;
try
{
project = assembleLineage( model, lineage, config, projectDescriptor, parentSearchRepositories,
aggregatedRemoteWagonRepositories, strict );
}
catch ( InvalidRepositoryException e )
{
throw new ProjectBuildingException( projectId, e.getMessage(), e );
}
// we don't have to force the collision exception for superModel here, it's already been done in getSuperModel()
MavenProject previousProject = superProject;
Model previous = superProject.getModel();
for ( Iterator i = lineage.iterator(); i.hasNext(); )
{
MavenProject currentProject = (MavenProject) i.next();
Model current = currentProject.getModel();
String pathAdjustment = null;
try
{
pathAdjustment = previousProject.getModulePathAdjustment( currentProject );
}
catch ( IOException e )
{
getLogger().debug( "Cannot determine whether " + currentProject.getId() + " is a module of " +
previousProject.getId() + ". Reason: " + e.getMessage(), e );
}
modelInheritanceAssembler.assembleModelInheritance( current, previous, pathAdjustment );
previous = current;
previousProject = currentProject;
}
// only add the super repository if it wasn't overridden by a profile or project
List repositories = new ArrayList( aggregatedRemoteWagonRepositories );
List superRepositories = buildArtifactRepositories( superModel );
for ( Iterator i = superRepositories.iterator(); i.hasNext(); )
{
ArtifactRepository repository = (ArtifactRepository) i.next();
if ( !repositories.contains( repository ) )
{
repositories.add( repository );
}