Final fix for the problem where snapshot plugin repositories from external profiles were not being used. Added code for setting remote repos to MavenProject, after profile injection.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@733655 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2009-01-12 09:02:50 +00:00
parent 9c67a22ddc
commit 192af339c6
1 changed files with 19 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@ -335,7 +336,25 @@ public class DefaultMavenProjectBuilder
projectProfiles.addAll( profileAdvisor.applyActivatedExternalProfiles( project.getModel(), project.getFile(), externalProfileManager ) );
project.setActiveProfiles( projectProfiles );
try
{
LinkedHashSet repoSet = new LinkedHashSet();
if ( ( model.getRepositories() != null ) && !model.getRepositories().isEmpty() )
{
repoSet.addAll( model.getRepositories() );
}
if ( ( model.getPluginRepositories() != null ) && !model.getPluginRepositories().isEmpty() )
{
repoSet.addAll( model.getPluginRepositories() );
}
project.setRemoteArtifactRepositories( mavenTools.buildArtifactRepositories( new ArrayList( repoSet ) ) );
}
catch ( Exception e )
{
e.printStackTrace();
}
return project;
}