public class ChainResolver extends AbstractResolver
Modifier and Type | Class and Description |
---|---|
static class |
ChainResolver.ResolvedModuleRevisionArtifactInfo |
Constructor and Description |
---|
ChainResolver() |
Modifier and Type | Method and Description |
---|---|
void |
abortPublishTransaction() |
void |
add(DependencyResolver resolver) |
void |
beginPublishTransaction(ModuleRevisionId module,
boolean overwrite) |
void |
commitPublishTransaction() |
DownloadReport |
download(Artifact[] artifacts,
DownloadOptions options)
Download artifacts with specified DownloadOptions.
|
ArtifactDownloadReport |
download(ArtifactOrigin artifact,
DownloadOptions options)
Default implementation downloads the artifact without taking advantage of its location
|
void |
dumpSettings() |
boolean |
exists(Artifact artifact)
Returns
true if the given artifact can be located by this resolver and actually
exist. |
ResolvedResource |
findIvyFileRef(DependencyDescriptor dd,
ResolveData data)
Finds the module descriptor for the specified DependencyDescriptor.
|
ResolvedModuleRevision |
getDependency(DependencyDescriptor dd,
ResolveData data)
Resolve a module by id, getting its module descriptor and resolving the revision if it's a
latest one (i.e.
|
java.util.List |
getResolvers() |
boolean |
isDual() |
boolean |
isReturnFirst() |
java.util.Map[] |
listTokenValues(java.lang.String[] tokens,
java.util.Map criteria)
Same as
DependencyResolver.listTokenValues(String, Map) but more generic. |
ArtifactOrigin |
locate(Artifact artifact)
Default implementation actually download the artifact Subclasses should overwrite this to
avoid the download
|
void |
publish(Artifact artifact,
java.io.File src,
boolean overwrite) |
void |
reportFailure()
Reports last resolve failure as Messages
|
void |
reportFailure(Artifact art)
Reports last artifact download failure as Messages
|
void |
setDual(boolean b) |
void |
setReturnFirst(boolean returnFirst) |
checkInterrupted, checkLatest, doValidate, findModuleInCache, findModuleInCache, fromSystem, fromSystem, getCacheDownloadOptions, getCacheOptions, getChangingMatcherName, getChangingPattern, getDownloadOptions, getEventManager, getLatest, getLatestStrategy, getName, getNamespace, getParserSettings, getRepositoryCacheManager, getSettings, getSystemNode, getTypeName, hidePassword, isAfter, isValidate, listModules, listOrganisations, listRevisions, listTokenValues, saveModuleRevisionIfNeeded, setCache, setChangingMatcher, setChangingPattern, setCheckmodified, setEventManager, setLatest, setLatestStrategy, setName, setNamespace, setRepositoryCacheManager, setSettings, setValidate, toString, toSystem, toSystem, toSystem, toSystem, toSystem, toSystem, validate
public void add(DependencyResolver resolver)
public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws java.text.ParseException
DependencyResolver
java.text.ParseException
public ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data)
DependencyResolver
dd
- the dependency descriptordata
- the resolve datapublic java.util.Map[] listTokenValues(java.lang.String[] tokens, java.util.Map criteria)
DependencyResolver
DependencyResolver.listTokenValues(String, Map)
but more generic.listTokenValues
in interface DependencyResolver
listTokenValues
in class AbstractResolver
tokens
- the tokens of the querycriteria
- the token which have valuesnull
public void reportFailure()
DependencyResolver
reportFailure
in interface DependencyResolver
reportFailure
in class AbstractResolver
public void reportFailure(Artifact art)
DependencyResolver
reportFailure
in interface DependencyResolver
reportFailure
in class AbstractResolver
public DownloadReport download(Artifact[] artifacts, DownloadOptions options)
DependencyResolver
The resolver will always make a best effort, and do not stop when an artifact is not available. It rather continue to attempt to download other requested artifacts, and report what has been done in the returned DownloadReport.
The returned DownloadReport is never null
, and always contain an
ArtifactDownloadReport
for each requested Artifact.
artifacts
- an array of artifacts to download. Must not be null
.options
- options to apply for this download. Must not be null
.public java.util.List getResolvers()
public void publish(Artifact artifact, java.io.File src, boolean overwrite) throws java.io.IOException
java.io.IOException
public void abortPublishTransaction() throws java.io.IOException
abortPublishTransaction
in interface DependencyResolver
abortPublishTransaction
in class AbstractResolver
java.io.IOException
public void beginPublishTransaction(ModuleRevisionId module, boolean overwrite) throws java.io.IOException
beginPublishTransaction
in interface DependencyResolver
beginPublishTransaction
in class AbstractResolver
java.io.IOException
public void commitPublishTransaction() throws java.io.IOException
commitPublishTransaction
in interface DependencyResolver
commitPublishTransaction
in class AbstractResolver
java.io.IOException
public boolean isReturnFirst()
public void setReturnFirst(boolean returnFirst)
public void dumpSettings()
dumpSettings
in interface DependencyResolver
dumpSettings
in class AbstractResolver
public boolean exists(Artifact artifact)
DependencyResolver
true
if the given artifact can be located by this resolver and actually
exist.exists
in interface DependencyResolver
exists
in class AbstractResolver
artifact
- the artifact which should be tested.true
if the given artifact can be located by this resolver and actually
exist.public ArtifactOrigin locate(Artifact artifact)
AbstractResolver
locate
in interface DependencyResolver
locate
in class AbstractResolver
artifact
- the artifact which should be locatednull
if it can't be located by this resolver
or doesn't exist.public ArtifactDownloadReport download(ArtifactOrigin artifact, DownloadOptions options)
AbstractResolver
download
in interface DependencyResolver
download
in class AbstractResolver
artifact
- the location of the artifact to download. Must not be null
.options
- options to apply for this download. Must not be null
.null
.public void setDual(boolean b)
public boolean isDual()