o Added method to clone/fork model resolver which is a prerequisite for importing other POMs/mixins during the model building where the model builder basically recurses and we want the resolution processes for these sub POMs to be isolated

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@795227 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-17 21:07:11 +00:00
parent ef13f229e8
commit 70ae109093
2 changed files with 15 additions and 0 deletions

View File

@ -82,6 +82,12 @@ class RepositoryModelResolver
this.remoteRepositories = new ArrayList<ArtifactRepository>( remoteRepositories );
}
public ModelResolver newCopy()
{
return new RepositoryModelResolver( repositorySystem, resolutionErrorHandler, localRepository,
remoteRepositories );
}
public void addRepository( Repository repository )
throws InvalidRepositoryException
{

View File

@ -55,4 +55,13 @@ public interface ModelResolver
void addRepository( Repository repository )
throws InvalidRepositoryException;
/**
* Clones this resolver for usage in a forked resolution process. In general, implementors need not provide a deep
* clone. The only requirement is that invocations of {@link #addRepository(Repository)} on the clone do not affect
* the state of the original resolver and vice versa.
*
* @return The cloned resolver, never {@code null}.
*/
ModelResolver newCopy();
}