mirror of https://github.com/apache/maven.git
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:
parent
a82951eb05
commit
b4df2f1bb3
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue