[MNG-7046] Revert MNG-5639 and make repo config static only

This closes #409
This commit is contained in:
Michael Osipov 2020-12-02 23:24:06 +01:00
parent 7f63daccc7
commit 8c9c303f9c
5 changed files with 3 additions and 58 deletions

View File

@ -93,9 +93,8 @@ public class ProjectModelResolver
this.resolver = resolver;
this.remoteRepositoryManager = remoteRepositoryManager;
this.pomRepositories = new ArrayList<>();
this.externalRepositories = Collections.unmodifiableList( new ArrayList<>( repositories ) );
this.repositories = new ArrayList<>();
this.repositories.addAll( externalRepositories );
this.externalRepositories = repositories;
this.repositories = repositories;
this.repositoryMerging = repositoryMerging;
this.repositoryIds = new HashSet<>();
this.modelPool = modelPool;

View File

@ -238,16 +238,6 @@ public class DefaultMavenProjectBuilderTest
}
}
public void testImportScopePomResolvesFromPropertyBasedRepository()
throws Exception
{
File pomFile = getTestFile( "src/test/resources/projects/import-scope-pom-resolves-from-property-based-repository.xml" );
ProjectBuildingRequest request = newBuildingRequest();
request.setProcessPlugins( false );
request.setResolveDependencies( true );
projectBuilder.build( pomFile, request );
}
/**
* Tests whether local version range parent references are build correctly.
*

View File

@ -1,31 +0,0 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>imported-pom-found</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<repo.url>file:src/test/remote-repo</repo.url>
</properties>
<repositories>
<repository>
<id>central</id>
<url>${repo.url}</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.its</groupId>
<artifactId>a</artifactId>
<version>0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -484,9 +484,6 @@ public class DefaultModelBuilder
result.setEffectiveModel( resultModel );
// Now the fully interpolated model is available: reconfigure the resolver
configureResolver( request.getModelResolver(), resultModel, problems, true );
return resultModel;
}
@ -842,12 +839,6 @@ public class DefaultModelBuilder
}
private void configureResolver( ModelResolver modelResolver, Model model, DefaultModelProblemCollector problems )
{
configureResolver( modelResolver, model, problems, false );
}
private void configureResolver( ModelResolver modelResolver, Model model, DefaultModelProblemCollector problems,
boolean replaceRepositories )
{
if ( modelResolver == null )
{
@ -862,7 +853,7 @@ public class DefaultModelBuilder
{
try
{
modelResolver.addRepository( repository, replaceRepositories );
modelResolver.addRepository( repository, false );
}
catch ( InvalidRepositoryException e )
{

View File

@ -67,8 +67,6 @@ class DefaultModelResolver
private List<RemoteRepository> repositories;
private final List<RemoteRepository> externalRepositories;
private final ArtifactResolver resolver;
private final VersionRangeResolver versionRangeResolver;
@ -88,7 +86,6 @@ class DefaultModelResolver
this.versionRangeResolver = versionRangeResolver;
this.remoteRepositoryManager = remoteRepositoryManager;
this.repositories = repositories;
this.externalRepositories = Collections.unmodifiableList( new ArrayList<>( repositories ) );
this.repositoryIds = new HashSet<>();
}
@ -102,7 +99,6 @@ class DefaultModelResolver
this.versionRangeResolver = original.versionRangeResolver;
this.remoteRepositoryManager = original.remoteRepositoryManager;
this.repositories = new ArrayList<>( original.repositories );
this.externalRepositories = original.externalRepositories;
this.repositoryIds = new HashSet<>();
}