o Fixed injection of repos from settings.xml

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@775626 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-05-17 11:13:32 +00:00
parent a82951eb05
commit b4df2f1bb3
2 changed files with 41 additions and 18 deletions

View File

@ -680,7 +680,19 @@ public class DefaultMavenExecutionRequest
public MavenExecutionRequest addProfile( Profile profile )
{
// TODO Auto-generated method stub
return null;
if ( profile == null )
{
throw new IllegalArgumentException( "profile missing" );
}
if ( profiles == null )
{
profiles = new ArrayList<Profile>();
}
profiles.add( profile );
return this;
}
}

View File

@ -231,24 +231,35 @@ public class MavenProject
this.repositorySystem = repositorySystem;
originalModel = model;
setRemoteArtifactRepositories( (projectBuilderConfiguration.getRemoteRepositories() != null) ? new ArrayList<ArtifactRepository>(projectBuilderConfiguration.getRemoteRepositories()) : new ArrayList<ArtifactRepository>());
for(Repository r: model.getPluginRepositories())
{
try {
remoteArtifactRepositories.add(repositorySystem.buildArtifactRepository( r ));
} catch (InvalidRepositoryException e) {
remoteArtifactRepositories = new ArrayList<ArtifactRepository>();
}
}
for(Repository r: model.getPluginRepositories())
{
try {
remoteArtifactRepositories.add(repositorySystem.buildArtifactRepository( r ));
} catch (InvalidRepositoryException e) {
for ( Repository r : model.getRepositories() )
{
try
{
remoteArtifactRepositories.add( repositorySystem.buildArtifactRepository( r ) );
}
catch ( InvalidRepositoryException e )
{
}
}
}
}
for ( Repository r : model.getPluginRepositories() )
{
try
{
remoteArtifactRepositories.add( repositorySystem.buildArtifactRepository( r ) );
}
catch ( InvalidRepositoryException e )
{
}
}
if ( projectBuilderConfiguration.getRemoteRepositories() != null )
{
remoteArtifactRepositories.addAll( projectBuilderConfiguration.getRemoteRepositories() );
}
}
// TODO: Find a way to use <relativePath/> here...it's tricky, because the moduleProject