Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0-beta-1
-
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.