Package org.eclipse.aether.resolution
Class ArtifactResult
java.lang.Object
org.eclipse.aether.resolution.ArtifactResult
The result of an artifact resolution request.
-
Constructor Summary
ConstructorDescriptionArtifactResult
(ArtifactRequest request) Creates a new result for the specified request. -
Method Summary
Modifier and TypeMethodDescriptionaddException
(Exception exception) Records the specified exception while resolving the artifact.Gets the resolved artifact (if any).Gets the exceptions that occurred while resolving the artifact.Gets theLocalArtifactResult
received during artifact resolution.Gets the repository from which the artifact was eventually resolved.Gets the resolution request that was made.boolean
Indicates whether the requested artifact is not present in any of the specified repositories.boolean
Indicates whether the requested artifact was resolved.setArtifact
(Artifact artifact) Sets the resolved artifact.void
setLocalArtifactResult
(LocalArtifactResult localArtifactResult) Sets theLocalArtifactResult
that is received during artifact resolution.setRepository
(ArtifactRepository repository) Sets the repository from which the artifact was resolved.toString()
-
Constructor Details
-
ArtifactResult
Creates a new result for the specified request.- Parameters:
request
- The resolution request, must not benull
.
-
-
Method Details
-
getRequest
Gets the resolution request that was made.- Returns:
- The resolution request, never
null
.
-
getArtifact
Gets the resolved artifact (if any). UsegetExceptions()
to query the errors that occurred while trying to resolve the artifact.- Returns:
- The resolved artifact or
null
if the resolution failed.
-
setArtifact
Sets the resolved artifact.- Parameters:
artifact
- The resolved artifact, may benull
if the resolution failed.- Returns:
- This result for chaining, never
null
.
-
getExceptions
Gets the exceptions that occurred while resolving the artifact. Note that this list can be non-empty even if the artifact was successfully resolved, e.g. when one of the contacted remote repositories didn't contain the artifact but a later repository eventually contained it.- Returns:
- The exceptions that occurred, never
null
. - See Also:
-
addException
Records the specified exception while resolving the artifact.- Parameters:
exception
- The exception to record, may benull
.- Returns:
- This result for chaining, never
null
.
-
getRepository
Gets the repository from which the artifact was eventually resolved. Note that successive resolutions of the same artifact might yield different results if the employed local repository does not track the origin of an artifact.- Returns:
- The repository from which the artifact was resolved or
null
if unknown.
-
setRepository
Sets the repository from which the artifact was resolved.- Parameters:
repository
- The repository from which the artifact was resolved, may benull
.- Returns:
- This result for chaining, never
null
.
-
getLocalArtifactResult
Gets theLocalArtifactResult
received during artifact resolution.- Returns:
- The
LocalArtifactResult
ornull
. - Since:
- 1.9.6
-
setLocalArtifactResult
Sets theLocalArtifactResult
that is received during artifact resolution.- Parameters:
localArtifactResult
- The local artifact result.- Since:
- 1.9.6
-
isResolved
Indicates whether the requested artifact was resolved. Note that the artifact might have been successfully resolved despitegetExceptions()
indicating transfer errors while trying to fetch the artifact from some of the specified remote repositories.- Returns:
true
if the artifact was resolved,false
otherwise.- See Also:
-
isMissing
Indicates whether the requested artifact is not present in any of the specified repositories.- Returns:
true
if the artifact is not present in any repository,false
otherwise.
-
toString
-