Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4729

Mirrors and servers not accessed properly by plugin on a build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0-beta-1
    • 3.0-beta-2
    • None
    • None
    • Patch

    Description

      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.

      Attachments

        1. patch.txt
          1 kB
          Eric Berry

        Activity

          People

            bentmann Benjamin Bentmann
            ericeberry Eric Berry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: