public interface ModelResolver
ModelBuilder
will add any relevant repositories to the model resolver. In
other words, the model resolver is stateful and should not be reused across multiple model building requests.Modifier and Type | Method and Description |
---|---|
void |
addRepository(Repository repository)
Adds a repository to use for subsequent resolution requests.
|
void |
addRepository(Repository repository,
boolean replace)
Adds a repository to use for subsequent resolution requests.
|
ModelResolver |
newCopy()
Clones this resolver for usage in a forked resolution process.
|
ModelSource |
resolveModel(Dependency dependency)
Tries to resolve the POM for the specified dependency coordinates possibly updating
dependency . |
ModelSource |
resolveModel(Parent parent)
Tries to resolve the POM for the specified parent coordinates possibly updating
parent . |
ModelSource |
resolveModel(String groupId,
String artifactId,
String version)
Tries to resolve the POM for the specified coordinates.
|
ModelSource resolveModel(String groupId, String artifactId, String version) throws UnresolvableModelException
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
.null
.UnresolvableModelException
- If the POM could not be resolved from any configured repository.ModelSource resolveModel(Parent parent) throws UnresolvableModelException
parent
.
Unlike the resolveModel(java.lang.String, java.lang.String, java.lang.String)
method, this method
supports version ranges and updates the given parent
instance to match the returned ModelSource
.
If parent
declares a version range, the version corresponding to the returned ModelSource
will
be set on the given parent
.
parent
- The parent coordinates to resolve, must not be null
.null
.UnresolvableModelException
- If the POM could not be resolved from any configured repository.Parent.clone()
ModelSource resolveModel(Dependency dependency) throws UnresolvableModelException
dependency
.
Unlike the resolveModel(java.lang.String, java.lang.String, java.lang.String)
method, this method
supports version ranges and updates the given dependency
instance to match the returned
ModelSource
. If dependency
declares a version range, the version corresponding to the returned
ModelSource
will be set on the given dependency
.
dependency
- The dependency coordinates to resolve, must not be null
.null
.UnresolvableModelException
- If the POM could not be resolved from any configured repository.Dependency.clone()
void addRepository(Repository repository) throws InvalidRepositoryException
repository
- The repository to add to the internal search chain, must not be null
.InvalidRepositoryException
- If the repository could not be added (e.g. due to invalid URL or layout).void addRepository(Repository repository, boolean replace) throws InvalidRepositoryException
repository
- The repository to add to the internal search chain, must not be null
.InvalidRepositoryException
- If the repository could not be added (e.g. due to invalid URL or layout).ModelResolver newCopy()
addRepository(Repository)
on the clone do not affect
the state of the original resolver and vice versa.null
.Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.