Class IBiblioResolver
- All Implemented Interfaces:
Validatable, DependencyResolver, HasLatestStrategy
- Direct Known Subclasses:
BintrayResolver
IBiblioResolver is a resolver which can be used to resolve dependencies found in the ibiblio
maven repository, or similar repositories.
For more flexibility with url and patterns, see
URLResolver.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringDeprecated.static final StringDeprecated.Fields inherited from class BasicResolver
DATE_FORMAT, DESCRIPTOR_OPTIONAL, DESCRIPTOR_REQUIRED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondownload(Artifact[] artifacts, DownloadOptions options) Download artifacts with specified DownloadOptions.voidvoidensureConfigured(ResolverSettings settings) booleanReturnstrueif the given artifact can be located by this resolver and actually exist.findArtifactRef(Artifact artifact, Date date) findIvyFileRef(DependencyDescriptor dd, ResolveData data) Finds the module descriptor for the specified DependencyDescriptor.protected voidfindTokenValues(Collection<String> names, List<String> patterns, Map<String, String> tokenValues, String token) 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.protected StringgetRoot()booleanbooleanprotected ResolvedResource[]listResources(Repository repository, ModuleRevisionId mrid, String pattern, Artifact artifact) List all revisions as resolved resources for the given artifact in the given repository using the given pattern, and using the given mrid except its revision.listRevisions(ModuleEntry mod) protected String[]listTokenValues(String pattern, String token) String[]listTokenValues(String token, Map<String, String> otherTokenValues) List all the values the given token can take if other tokens are set as described in the otherTokenValues map.Default implementation actually download the artifact Subclasses should overwrite this to avoid the downloadvoidvoidsetM2compatible(boolean m2compatible) voidsetPattern(String pattern) voidSets the root of the maven like repository.voidsetUseMavenMetadata(boolean useMavenMetadata) voidsetUsepoms(boolean usepoms) Methods inherited from class RepositoryResolver
exist, findResourceUsingPattern, get, getDestination, getRepository, getResource, isAlwaysCheckExactRevision, publish, put, putChecksum, putSignature, setAlwaysCheckExactRevision, setName, setRepository, setSettings, setSignerMethods inherited from class AbstractPatternsBasedResolver
addArtifactPattern, addConfiguredArtifact, addConfiguredIvy, addIvyPattern, convertM2CriteriaForResourceSearch, convertM2IdForResourceSearch, convertM2OrganizationForResourceSearch, convertM2ResourceSearchIdToNormal, convertM2TokenValuesForResourceSearch, findArtifactNames, findIvyNames, findNames, findResource, findResourceUsingPatterns, getIvyPatterns, isM2compatible, listTokenValues, setArtifactPatterns, setIvyPatternsMethods inherited from class BasicResolver
acceptLatest, checkModuleDescriptorRevision, clearArtifactAttempts, clearIvyAttempts, doFindArtifactRef, download, filterNames, findFirstArtifactRef, getAndCheck, getArtifactRef, getChecksumAlgorithms, getDefaultRMDParser, getPublicationDate, getRMDParser, getWorkspaceName, isAllownomd, isCheckconsistency, isEnvDependent, isForce, logArtifactAttempt, logAttempt, logIvyAttempt, parse, reportFailure, reportFailure, setAllownomd, setCheckconsistency, setChecksums, setDescriptor, setEnvDependent, setForce, setWorkspaceName, shouldReturnResolvedModule, toStringMethods inherited from class AbstractResolver
abortPublishTransaction, beginPublishTransaction, checkInterrupted, checkLatest, commitPublishTransaction, doValidate, findModuleInCache, findModuleInCache, fromSystem, fromSystem, getCacheDownloadOptions, getCacheOptions, getChangingMatcherName, getChangingPattern, getDownloadOptions, getEventManager, getLatest, getLatestStrategy, getName, getNamespace, getParserSettings, getRepositoryCacheManager, getSettings, getSystemNode, getTimeoutConstraint, hidePassword, isAfter, isValidate, saveModuleRevisionIfNeeded, setCache, setChangingMatcher, setChangingPattern, setCheckmodified, setEventManager, setLatest, setLatestStrategy, setNamespace, setRepositoryCacheManager, setTimeoutConstraint, setValidate, toSystem, toSystem, toSystem, toSystem, toSystem, toSystem, validate
-
Field Details
-
DEFAULT_PATTERN
-
DEFAULT_ROOT
-
DEFAULT_M2_ROOT
- See Also:
-
-
Constructor Details
-
IBiblioResolver
public IBiblioResolver()
-
-
Method Details
-
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.- Specified by:
findIvyFileRefin interfaceDependencyResolver- Overrides:
findIvyFileRefin classAbstractPatternsBasedResolver- Parameters:
dd- the dependency descriptordata- the resolve data- Returns:
- the module descriptor, or null
-
findArtifactRef
- Overrides:
findArtifactRefin classAbstractPatternsBasedResolver
-
setM2compatible
public void setM2compatible(boolean m2compatible) - Overrides:
setM2compatiblein classAbstractPatternsBasedResolver
-
ensureConfigured
-
getModuleDescriptorExtension
- Overrides:
getModuleDescriptorExtensionin classAbstractPatternsBasedResolver
-
getPattern
-
setPattern
-
getRoot
-
setRoot
Sets the root of the maven like repository. The maven like repository is necessarily an http repository.- Parameters:
root- the root of the maven like repository- Throws:
IllegalArgumentException- if root does not start with "http://"
-
publish
-
listTokenValues
Description copied from interface:DependencyResolverList all the values the given token can take if other tokens are set as described in the otherTokenValues map. For instance, if token = "revision" and the map contains "organisation"->"foo" "module"->"bar" The results will be the list of revisions of the module bar from the org foo.Note that listing does not take into account namespaces, and return raw information without any namespace transformation. The caller is responsible for calling namespace transformation with the Namespace returned by
DependencyResolver.getNamespace().- Specified by:
listTokenValuesin interfaceDependencyResolver- Overrides:
listTokenValuesin classBasicResolver- Parameters:
token- StringotherTokenValues- Map- Returns:
- String[]
-
listTokenValues
- Overrides:
listTokenValuesin classRepositoryResolver
-
listOrganisations
- Specified by:
listOrganisationsin interfaceDependencyResolver- Overrides:
listOrganisationsin classBasicResolver
-
listModules
- Specified by:
listModulesin interfaceDependencyResolver- Overrides:
listModulesin classBasicResolver
-
listRevisions
- Specified by:
listRevisionsin interfaceDependencyResolver- Overrides:
listRevisionsin classBasicResolver
-
listResources
protected ResolvedResource[] listResources(Repository repository, ModuleRevisionId mrid, String pattern, Artifact artifact) Description copied from class:RepositoryResolverList all revisions as resolved resources for the given artifact in the given repository using the given pattern, and using the given mrid except its revision.- Overrides:
listResourcesin classRepositoryResolver- Parameters:
repository- the repository in which revisions should be locatedmrid- the module revision id to look for (except revision)pattern- the pattern to use to locate the revisionsartifact- the artifact to find- Returns:
- an array of ResolvedResource, all pointing to a different revision of the given Artifact.
-
findTokenValues
protected void findTokenValues(Collection<String> names, List<String> patterns, Map<String, String> tokenValues, String token) - Overrides:
findTokenValuesin classRepositoryResolver
-
getTypeName
- Overrides:
getTypeNamein classURLResolver
-
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 ##)- Specified by:
getDependencyin interfaceDependencyResolver- Overrides:
getDependencyin classBasicResolver- Parameters:
dd- DependencyDescriptordata- ResolveData- Returns:
- ResolvedModuleRevision
- Throws:
ParseException- if something goes wrong
-
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.- Specified by:
downloadin interfaceDependencyResolver- Overrides:
downloadin classRepositoryResolver- 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.
-
exists
Description copied from interface:DependencyResolverReturnstrueif the given artifact can be located by this resolver and actually exist.- Specified by:
existsin interfaceDependencyResolver- Overrides:
existsin classBasicResolver- 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 classBasicResolver- Parameters:
artifact- ArtifactOrigin- Returns:
- ArtifactOrigin
-
getArtifactPatterns
- Overrides:
getArtifactPatternsin classAbstractPatternsBasedResolver
-
isUsepoms
public boolean isUsepoms() -
setUsepoms
public void setUsepoms(boolean usepoms) -
isUseMavenMetadata
public boolean isUseMavenMetadata() -
setUseMavenMetadata
public void setUseMavenMetadata(boolean useMavenMetadata) -
dumpSettings
public void dumpSettings()- Specified by:
dumpSettingsin interfaceDependencyResolver- Overrides:
dumpSettingsin classRepositoryResolver
-