[MNG-4729] Mirrors and servers not accessed properly by plugin on a build

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@965101 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-07-17 16:19:24 +00:00
parent 89f49926af
commit bca95f0f62
1 changed files with 11 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import org.apache.maven.artifact.InvalidRepositoryException;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Repository;
import org.apache.maven.model.building.ModelBuildingException;
@ -148,6 +149,16 @@ public class DefaultMavenProjectBuilder
MavenSession session = legacySupport.getSession();
if ( session != null )
{
MavenExecutionRequest request = session.getRequest();
if ( request != null )
{
configuration.setServers( request.getServers() );
configuration.setMirrors( request.getMirrors() );
configuration.setProxies( request.getProxies() );
configuration.setTransferListener( request.getTransferListener() );
configuration.setForceUpdate( request.isUpdateSnapshots() );
}
configuration.setOffline( session.isOffline() );
configuration.setSystemProperties( session.getSystemProperties() );
configuration.setUserProperties( session.getUserProperties() );
}