Mirrors and servers not accessed properly by plugin on a build
--------------------------------------------------------------

                 Key: MNG-4729
                 URL: http://jira.codehaus.org/browse/MNG-4729
             Project: Maven 2 & 3
          Issue Type: Bug
    Affects Versions: 3.0-beta-1
            Reporter: Eric Berry
         Attachments: patch.txt

We are using the 
<groupId>org.scala-tools</groupId><artifactId>maven-scala-plugin</artifactId> 
plugin.  This makes a call into 
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository( 
Artifact artifact, List<ArtifactRepository> remoteRepositories, 
ArtifactRepository localRepository, boolean allowStubModel ).  While trying to 
download dependencies, this call was not using the username and password from a 
server when accessing a repository.  Furthermore it was also not replacing the 
repository with a mirror.

When I added the following code into that method, it fixed my problem:

        if ( session != null )
        {
-->         Settings settings = session.getSettings();
-->         configuration.setServers( settings.getServers() );
-->         configuration.setMirrors( settings.getMirrors() );
-->         configuration.setProxies( settings.getProxies() );

            configuration.setSystemProperties( session.getSystemProperties() );
            configuration.setUserProperties( session.getUserProperties() );
        }

Since I don't know the purpose for this method or the reasons for why this code 
was left out, I don't know if this is an appropriate fix, but it does fix my 
problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to