Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.0-beta-1
-
Fix Version/s: 3.0-beta-2
-
Component/s: None
-
Labels:None
-
Complexity:Intermediate
-
Patch Submitted:Yes
-
Number of attachments :
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.
Activity
| Field | Original Value | New Value |
|---|---|---|
| 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. |
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: {code:java} 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() ); } {code} 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. |
| Resolution | Fixed [ 1 ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |
| Assignee | Benjamin Bentmann [ bentmann ] | |
| Fix Version/s | 3.0-beta-2 [ 16090 ] |
Fixed in r965101, thanks for the patch!