Package org.apache.maven.project
Class ProjectModelResolver
java.lang.Object
org.apache.maven.project.ProjectModelResolver
- All Implemented Interfaces:
- ModelResolver
A model resolver to assist building of projects. This resolver gives priority to those repositories that have been
 declared in the POM.
- 
Constructor SummaryConstructorsConstructorDescriptionProjectModelResolver(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.RequestTrace trace, org.eclipse.aether.RepositorySystem resolver, org.eclipse.aether.impl.RemoteRepositoryManager remoteRepositoryManager, List<org.eclipse.aether.repository.RemoteRepository> repositories, ProjectBuildingRequest.RepositoryMerging repositoryMerging, org.apache.maven.project.ReactorModelPool modelPool) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddRepository(Repository repository) voidaddRepository(Repository repository, boolean replace) voidaddRepository(Repository repository) Adds a repository to use for subsequent resolution requests.voidaddRepository(Repository repository, boolean replace) Adds a repository to use for subsequent resolution requests.newCopy()Clones this resolver for usage in a forked resolution process.resolveModel(String groupId, String artifactId, String version) Tries to resolve the POM for the specified coordinates.resolveModel(Dependency dependency, AtomicReference<Dependency> modified) resolveModel(Parent parent, AtomicReference<Parent> modified) resolveModel(Dependency dependency) Tries to resolve the POM for the specified dependency coordinates possibly updatingdependency.resolveModel(Parent parent) Tries to resolve the POM for the specified parent coordinates possibly updatingparent.
- 
Constructor Details- 
ProjectModelResolverpublic ProjectModelResolver(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.RequestTrace trace, org.eclipse.aether.RepositorySystem resolver, org.eclipse.aether.impl.RemoteRepositoryManager remoteRepositoryManager, List<org.eclipse.aether.repository.RemoteRepository> repositories, ProjectBuildingRequest.RepositoryMerging repositoryMerging, org.apache.maven.project.ReactorModelPool modelPool) 
 
- 
- 
Method Details- 
addRepository- Specified by:
- addRepositoryin interface- ModelResolver
- Throws:
- InvalidRepositoryException
 
- 
addRepository- Specified by:
- addRepositoryin interface- ModelResolver
- Throws:
- InvalidRepositoryException
 
- 
newCopyDescription copied from interface:ModelResolverClones this resolver for usage in a forked resolution process. In general, implementors need not provide a deep clone. The only requirement is that invocations ofModelResolver.addRepository(Repository)on the clone do not affect the state of the original resolver and vice versa.- Specified by:
- newCopyin interface- ModelResolver
- Returns:
- The cloned resolver, never null.
 
- 
resolveModelpublic ModelSource resolveModel(String groupId, String artifactId, String version) throws UnresolvableModelException Description copied from interface:ModelResolverTries to resolve the POM for the specified coordinates.- Specified by:
- resolveModelin interface- ModelResolver
- Parameters:
- groupId- The group identifier of the POM, must not be- null.
- artifactId- The artifact identifier of the POM, must not be- null.
- version- The version of the POM, must not be- null.
- Returns:
- The source of the requested POM, never null.
- Throws:
- UnresolvableModelException- If the POM could not be resolved from any configured repository.
 
- 
resolveModelpublic ModelSource resolveModel(Parent parent, AtomicReference<Parent> modified) throws UnresolvableModelException - Specified by:
- resolveModelin interface- ModelResolver
- Throws:
- UnresolvableModelException
 
- 
resolveModelpublic ModelSource resolveModel(Dependency dependency, AtomicReference<Dependency> modified) throws UnresolvableModelException - Specified by:
- resolveModelin interface- ModelResolver
- Throws:
- UnresolvableModelException
 
- 
resolveModelDescription copied from interface:ModelResolverTries to resolve the POM for the specified parent coordinates possibly updatingparent.Unlike the ModelResolver.resolveModel(java.lang.String, java.lang.String, java.lang.String)method, this method supports version ranges and updates the givenparentinstance to match the returnedModelSource. Ifparentdeclares a version range, the version corresponding to the returnedModelSourcewill be set on the givenparent.- Specified by:
- resolveModelin interface- ModelResolver
- Parameters:
- parent- The parent coordinates to resolve, must not be- null.
- Returns:
- The source of the requested POM, never null.
- Throws:
- UnresolvableModelException- If the POM could not be resolved from any configured repository.
- See Also:
 
- 
resolveModelDescription copied from interface:ModelResolverTries to resolve the POM for the specified dependency coordinates possibly updatingdependency.Unlike the ModelResolver.resolveModel(java.lang.String, java.lang.String, java.lang.String)method, this method supports version ranges and updates the givendependencyinstance to match the returnedModelSource. Ifdependencydeclares a version range, the version corresponding to the returnedModelSourcewill be set on the givendependency.- Specified by:
- resolveModelin interface- ModelResolver
- Parameters:
- dependency- The dependency coordinates to resolve, must not be- null.
- Returns:
- The source of the requested POM, never null.
- Throws:
- UnresolvableModelException- If the POM could not be resolved from any configured repository.
- See Also:
 
- 
addRepositoryDescription copied from interface:ModelResolverAdds a repository to use for subsequent resolution requests. The order in which repositories are added matters, repositories that were added first should also be searched first. When multiple repositories with the same identifier are added, only the first repository being added will be used.- Specified by:
- addRepositoryin interface- ModelResolver
- Parameters:
- repository- The repository to add to the internal search chain, must not be- null.
- Throws:
- InvalidRepositoryException- If the repository could not be added (e.g. due to invalid URL or layout).
 
- 
addRepositoryDescription copied from interface:ModelResolverAdds a repository to use for subsequent resolution requests. The order in which repositories are added matters, repositories that were added first should also be searched first. When multiple repositories with the same identifier are added, then the value of the replace argument determines the behaviour. If replace is false then any existing repository with the same Id will remain in use. If replace is true the new repository replaces the original.- Specified by:
- addRepositoryin interface- ModelResolver
- Parameters:
- repository- The repository to add to the internal search chain, must not be- null.
- Throws:
- InvalidRepositoryException- If the repository could not be added (e.g. due to invalid URL or layout).
 
 
-