Package org.apache.ivy.plugins.resolver
Class ChainResolver
java.lang.Object
org.apache.ivy.plugins.resolver.AbstractResolver
org.apache.ivy.plugins.resolver.ChainResolver
- All Implemented Interfaces:
Validatable,DependencyResolver,HasLatestStrategy
- Direct Known Subclasses:
WorkspaceChainResolver
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidadd(DependencyResolver resolver) voidbeginPublishTransaction(ModuleRevisionId module, boolean overwrite) voiddownload(ArtifactOrigin artifact, DownloadOptions options) Default implementation downloads the artifact without taking advantage of its locationdownload(Artifact[] artifacts, DownloadOptions options) Download artifacts with specified DownloadOptions.voidbooleanReturnstrueif the given artifact can be located by this resolver and actually exist.findIvyFileRef(DependencyDescriptor dd, ResolveData data) Finds the module descriptor for the specified DependencyDescriptor.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.booleanisDual()booleanlistTokenValues(String[] tokens, Map<String, Object> criteria) Same asDependencyResolver.listTokenValues(String, Map)but more generic.Default implementation actually download the artifact Subclasses should overwrite this to avoid the downloadvoidvoidReports last resolve failure as MessagesvoidreportFailure(Artifact art) Reports last artifact download failure as MessagesvoidsetDual(boolean b) voidsetReturnFirst(boolean returnFirst) Methods inherited from class org.apache.ivy.plugins.resolver.AbstractResolver
checkInterrupted, checkLatest, doValidate, findModuleInCache, findModuleInCache, fromSystem, fromSystem, getCacheDownloadOptions, getCacheOptions, getChangingMatcherName, getChangingPattern, getDownloadOptions, getEventManager, getLatest, getLatestStrategy, getName, getNamespace, getParserSettings, getRepositoryCacheManager, getSettings, getSystemNode, getTimeoutConstraint, getTypeName, hidePassword, isAfter, isValidate, listModules, listOrganisations, listRevisions, listTokenValues, saveModuleRevisionIfNeeded, setCache, setChangingMatcher, setChangingPattern, setCheckmodified, setEventManager, setLatest, setLatestStrategy, setName, setNamespace, setRepositoryCacheManager, setSettings, setTimeoutConstraint, setValidate, toString, toSystem, toSystem, toSystem, toSystem, toSystem, toSystem, validate
-
Constructor Details
-
ChainResolver
public ChainResolver()
-
-
Method Details
-
add
-
getDependency
public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws ParseException Description copied from interface:DependencyResolverResolve a module by id, getting its module descriptor and resolving the revision if it's a latest one (i.e. a revision uniquely identifying the revision of a module in the current environment - If this revision is not able to identify uniquely the revision of the module outside of the current environment, then the resolved revision must begin by ##)- Parameters:
dd- DependencyDescriptordata- ResolveData- Returns:
- ResolvedModuleRevision
- Throws:
ParseException- if something goes wrong
-
findIvyFileRef
Description copied from interface:DependencyResolverFinds the module descriptor for the specified DependencyDescriptor. If this resolver can't find the module descriptor, null is returned.- Parameters:
dd- the dependency descriptordata- the resolve data- Returns:
- the module descriptor, or null
-
listTokenValues
Description copied from interface:DependencyResolverSame asDependencyResolver.listTokenValues(String, Map)but more generic.- Specified by:
listTokenValuesin interfaceDependencyResolver- Overrides:
listTokenValuesin classAbstractResolver- Parameters:
tokens- the tokens of the querycriteria- the token which have values- Returns:
- the list of token values, must not be
null
-
reportFailure
public void reportFailure()Description copied from interface:DependencyResolverReports last resolve failure as Messages- Specified by:
reportFailurein interfaceDependencyResolver- Overrides:
reportFailurein classAbstractResolver
-
reportFailure
Description copied from interface:DependencyResolverReports last artifact download failure as Messages- Specified by:
reportFailurein interfaceDependencyResolver- Overrides:
reportFailurein classAbstractResolver- Parameters:
art- Artifact
-
download
Description copied from interface:DependencyResolverDownload artifacts with specified DownloadOptions.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 anArtifactDownloadReportfor each requested Artifact.- Parameters:
artifacts- an array of artifacts to download. Must not benull.options- options to apply for this download. Must not benull.- Returns:
- a DownloadReport with details about each Artifact download.
-
getResolvers
-
publish
- Throws:
IOException
-
abortPublishTransaction
- Specified by:
abortPublishTransactionin interfaceDependencyResolver- Overrides:
abortPublishTransactionin classAbstractResolver- Throws:
IOException
-
beginPublishTransaction
- Specified by:
beginPublishTransactionin interfaceDependencyResolver- Overrides:
beginPublishTransactionin classAbstractResolver- Throws:
IOException
-
commitPublishTransaction
- Specified by:
commitPublishTransactionin interfaceDependencyResolver- Overrides:
commitPublishTransactionin classAbstractResolver- Throws:
IOException
-
isReturnFirst
public boolean isReturnFirst() -
setReturnFirst
public void setReturnFirst(boolean returnFirst) -
dumpSettings
public void dumpSettings()- Specified by:
dumpSettingsin interfaceDependencyResolver- Overrides:
dumpSettingsin classAbstractResolver
-
exists
Description copied from interface:DependencyResolverReturnstrueif the given artifact can be located by this resolver and actually exist.- Specified by:
existsin interfaceDependencyResolver- Overrides:
existsin classAbstractResolver- Parameters:
artifact- the artifact which should be tested.- Returns:
trueif the given artifact can be located by this resolver and actually exist.
-
locate
Description copied from class:AbstractResolverDefault implementation actually download the artifact Subclasses should overwrite this to avoid the download- Specified by:
locatein interfaceDependencyResolver- Overrides:
locatein classAbstractResolver- Parameters:
artifact- ArtifactOrigin- Returns:
- ArtifactOrigin
-
download
Description copied from class:AbstractResolverDefault implementation downloads the artifact without taking advantage of its location- Specified by:
downloadin interfaceDependencyResolver- Overrides:
downloadin classAbstractResolver- Parameters:
artifact- ArtifactOriginoptions- DownloadOptions- Returns:
- ArtifactDownloadReport
-
setDual
public void setDual(boolean b) -
isDual
public boolean isDual()
-