Package org.apache.ivy.plugins.resolver
Class IvyRepResolver
- java.lang.Object
-
- All Implemented Interfaces:
Validatable
,DependencyResolver
,HasLatestStrategy
public class IvyRepResolver extends URLResolver
IvyRepResolver is a resolver which can be used to resolve dependencies found in the ivy official repository for ivy files and ibiblio maven repository for the artifacts, or similar repositories. For more flexibility with url and patterns, seeURLResolver
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_IVYPATTERN
static java.lang.String
DEFAULT_IVYROOT
-
Fields inherited from class org.apache.ivy.plugins.resolver.BasicResolver
DATE_FORMAT, DESCRIPTOR_OPTIONAL, DESCRIPTOR_REQUIRED
-
-
Constructor Summary
Constructors Constructor Description IvyRepResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DownloadReport
download(Artifact[] artifacts, DownloadOptions options)
Download artifacts with specified DownloadOptions.boolean
exists(Artifact artifact)
Returnstrue
if the given artifact can be located by this resolver and actually exist.ResolvedResource
findArtifactRef(Artifact artifact, java.util.Date date)
java.util.List<java.lang.String>
getArtifactPatterns()
java.lang.String
getArtpattern()
java.lang.String
getArtroot()
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.lang.String
getIvypattern()
java.util.List<java.lang.String>
getIvyPatterns()
java.lang.String
getIvyroot()
java.lang.String
getTypeName()
ModuleEntry[]
listModules(OrganisationEntry org)
OrganisationEntry[]
listOrganisations()
RevisionEntry[]
listRevisions(ModuleEntry mod)
ArtifactOrigin
locate(Artifact artifact)
Default implementation actually download the artifact Subclasses should overwrite this to avoid the downloadvoid
publish(Artifact artifact, java.io.File src)
void
setArtpattern(java.lang.String pattern)
void
setArtroot(java.lang.String root)
void
setIvypattern(java.lang.String pattern)
void
setIvyroot(java.lang.String root)
Sets the root of the maven like repository.void
setM2compatible(boolean m2compatible)
-
Methods inherited from class org.apache.ivy.plugins.resolver.RepositoryResolver
dumpSettings, exist, findResourceUsingPattern, findTokenValues, get, getDestination, getRepository, getResource, isAlwaysCheckExactRevision, listResources, listTokenValues, publish, put, putChecksum, putSignature, setAlwaysCheckExactRevision, setName, setRepository, setSettings, setSigner
-
Methods inherited from class org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver
addArtifactPattern, addConfiguredArtifact, addConfiguredIvy, addIvyPattern, convertM2CriteriaForResourceSearch, convertM2IdForResourceSearch, convertM2OrganizationForResourceSearch, convertM2ResourceSearchIdToNormal, convertM2TokenValuesForResourceSearch, findArtifactNames, findIvyFileRef, findIvyNames, findNames, findResource, findResourceUsingPatterns, getModuleDescriptorExtension, isM2compatible, listTokenValues, setArtifactPatterns, setIvyPatterns
-
Methods inherited from class org.apache.ivy.plugins.resolver.BasicResolver
acceptLatest, checkModuleDescriptorRevision, clearArtifactAttempts, clearIvyAttempts, doFindArtifactRef, download, filterNames, findFirstArtifactRef, getAndCheck, getArtifactRef, getChecksumAlgorithms, getDefaultRMDParser, getPublicationDate, getRMDParser, getWorkspaceName, isAllownomd, isCheckconsistency, isEnvDependent, isForce, listTokenValues, logArtifactAttempt, logAttempt, logIvyAttempt, parse, reportFailure, reportFailure, setAllownomd, setCheckconsistency, setChecksums, setDescriptor, setEnvDependent, setForce, setWorkspaceName, shouldReturnResolvedModule, toString
-
Methods inherited from class org.apache.ivy.plugins.resolver.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 Detail
-
DEFAULT_IVYPATTERN
public static final java.lang.String DEFAULT_IVYPATTERN
- See Also:
- Constant Field Values
-
DEFAULT_IVYROOT
public static final java.lang.String DEFAULT_IVYROOT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIvypattern
public java.lang.String getIvypattern()
-
setIvypattern
public void setIvypattern(java.lang.String pattern)
-
getIvyroot
public java.lang.String getIvyroot()
-
setIvyroot
public void setIvyroot(java.lang.String root)
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:
java.lang.IllegalArgumentException
- if root does not start with "http://"
-
setM2compatible
public void setM2compatible(boolean m2compatible)
- Overrides:
setM2compatible
in classAbstractPatternsBasedResolver
-
publish
public void publish(Artifact artifact, java.io.File src)
-
getArtroot
public java.lang.String getArtroot()
-
getArtpattern
public java.lang.String getArtpattern()
-
setArtpattern
public void setArtpattern(java.lang.String pattern)
-
setArtroot
public void setArtroot(java.lang.String root)
-
listOrganisations
public OrganisationEntry[] listOrganisations()
- Specified by:
listOrganisations
in interfaceDependencyResolver
- Overrides:
listOrganisations
in classBasicResolver
-
listModules
public ModuleEntry[] listModules(OrganisationEntry org)
- Specified by:
listModules
in interfaceDependencyResolver
- Overrides:
listModules
in classBasicResolver
-
listRevisions
public RevisionEntry[] listRevisions(ModuleEntry mod)
- Specified by:
listRevisions
in interfaceDependencyResolver
- Overrides:
listRevisions
in classBasicResolver
-
getTypeName
public java.lang.String getTypeName()
- Overrides:
getTypeName
in classURLResolver
-
getDependency
public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws java.text.ParseException
Description copied from interface:DependencyResolver
Resolve 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:
getDependency
in interfaceDependencyResolver
- Overrides:
getDependency
in classBasicResolver
- Parameters:
dd
- DependencyDescriptordata
- ResolveData- Returns:
- ResolvedModuleRevision
- Throws:
java.text.ParseException
- if something goes wrong
-
findArtifactRef
public ResolvedResource findArtifactRef(Artifact artifact, java.util.Date date)
- Overrides:
findArtifactRef
in classAbstractPatternsBasedResolver
-
download
public DownloadReport download(Artifact[] artifacts, DownloadOptions options)
Description copied from interface:DependencyResolver
Download 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 anArtifactDownloadReport
for each requested Artifact.- Specified by:
download
in interfaceDependencyResolver
- Overrides:
download
in 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
public boolean exists(Artifact artifact)
Description copied from interface:DependencyResolver
Returnstrue
if the given artifact can be located by this resolver and actually exist.- Specified by:
exists
in interfaceDependencyResolver
- Overrides:
exists
in classBasicResolver
- Parameters:
artifact
- the artifact which should be tested.- Returns:
true
if the given artifact can be located by this resolver and actually exist.
-
locate
public ArtifactOrigin locate(Artifact artifact)
Description copied from class:AbstractResolver
Default implementation actually download the artifact Subclasses should overwrite this to avoid the download- Specified by:
locate
in interfaceDependencyResolver
- Overrides:
locate
in classBasicResolver
- Parameters:
artifact
- ArtifactOrigin- Returns:
- ArtifactOrigin
-
getIvyPatterns
public java.util.List<java.lang.String> getIvyPatterns()
- Overrides:
getIvyPatterns
in classAbstractPatternsBasedResolver
-
getArtifactPatterns
public java.util.List<java.lang.String> getArtifactPatterns()
- Overrides:
getArtifactPatterns
in classAbstractPatternsBasedResolver
-
-