public class ResolveEngine
extends java.lang.Object
resolve(File)
and
resolve(URL)
which allow to simply resolve dependencies of a single module descriptor,
or more complete one, like the resolve(ModuleDescriptor, ResolveOptions)
which allows to
provide options to the resolution engine.ResolveOptions
Constructor and Description |
---|
ResolveEngine(ResolveEngineSettings settings,
EventManager eventManager,
SortEngine sortEngine)
Constructs a ResolveEngine.
|
Modifier and Type | Method and Description |
---|---|
ArtifactDownloadReport |
download(Artifact artifact,
DownloadOptions options)
Download an artifact to the cache.
|
ArtifactDownloadReport |
download(ArtifactOrigin origin,
DownloadOptions options)
Materialize an artifact already located.
|
void |
downloadArtifacts(ResolveReport report,
Filter<Artifact> artifactFilter,
DownloadOptions options) |
ResolvedModuleRevision |
findModule(ModuleRevisionId id,
ResolveOptions options) |
IvyNode[] |
getDependencies(ModuleDescriptor md,
ResolveOptions options,
ResolveReport report)
Resolve the dependencies of a module without downloading corresponding artifacts.
|
IvyNode[] |
getDependencies(java.net.URL ivySource,
ResolveOptions options)
Resolve the dependencies of a module without downloading corresponding artifacts.
|
DependencyResolver |
getDictatorResolver()
Returns the currently configured dictator resolver, which when non null is used in place of
any specified resolver in the
IvySettings |
EventManager |
getEventManager() |
ResolveEngineSettings |
getSettings() |
SortEngine |
getSortEngine() |
ArtifactOrigin |
locate(Artifact artifact)
Locates an artifact in dependency resolvers, and return its location if it can be located and
actually exists, or an unknown
ArtifactOrigin in other cases. |
DependencyDescriptor |
mediate(DependencyDescriptor dd,
ResolveOptions options)
Mediates the given dependency descriptor according to given options.
|
void |
outputReport(ResolveReport report,
ResolutionCacheManager cacheMgr,
ResolveOptions options) |
ResolveReport |
resolve(java.io.File ivySource) |
ResolveReport |
resolve(ModuleDescriptor md,
ResolveOptions options)
Resolve dependencies of a module described by a module descriptor.
|
ResolveReport |
resolve(ModuleRevisionId mrid,
ResolveOptions options,
boolean changing)
Resolves the module identified by the given mrid with its dependencies if transitive is set
to true.
|
ResolveReport |
resolve(java.net.URL ivySource) |
ResolveReport |
resolve(java.net.URL ivySource,
ResolveOptions options)
Resolve dependencies of a module described by an ivy file.
|
void |
setDictatorResolver(DependencyResolver dictatorResolver)
Sets a dictator resolver, which is used in place of regular dependency resolver for
subsequent dependency resolution by this engine.
|
public ResolveEngine(ResolveEngineSettings settings, EventManager eventManager, SortEngine sortEngine)
settings
- the settings to use to configure the engine. Must not be null.eventManager
- the event manager to use to send events about the resolution process. Must not be
null.sortEngine
- the sort engine to use to sort modules before producing the dependency resolution
report. Must not be null.public DependencyResolver getDictatorResolver()
IvySettings
public void setDictatorResolver(DependencyResolver dictatorResolver)
dictatorResolver
- the dictator resolver to use in this engine, null if regular settings should usedpublic ResolveReport resolve(java.io.File ivySource) throws java.text.ParseException, java.io.IOException
java.text.ParseException
java.io.IOException
public ResolveReport resolve(java.net.URL ivySource) throws java.text.ParseException, java.io.IOException
java.text.ParseException
java.io.IOException
public ResolveReport resolve(ModuleRevisionId mrid, ResolveOptions options, boolean changing) throws java.text.ParseException, java.io.IOException
mrid
- ModuleRevisionIdoptions
- ResolveOptionschanging
- booleanjava.text.ParseException
- if something goes wrongjava.io.IOException
- if something goes wrongpublic ResolveReport resolve(java.net.URL ivySource, ResolveOptions options) throws java.text.ParseException, java.io.IOException
ivySource
- URLoptions
- ResolveOptionsjava.text.ParseException
- if something goes wrongjava.io.IOException
- if something goes wrongpublic ResolveReport resolve(ModuleDescriptor md, ResolveOptions options) throws java.text.ParseException, java.io.IOException
md
- ModuleDescriptoroptions
- ResolveOptionsjava.text.ParseException
- if something goes wrongjava.io.IOException
- if something goes wrongpublic void outputReport(ResolveReport report, ResolutionCacheManager cacheMgr, ResolveOptions options) throws java.io.IOException
java.io.IOException
public void downloadArtifacts(ResolveReport report, Filter<Artifact> artifactFilter, DownloadOptions options)
public ArtifactDownloadReport download(Artifact artifact, DownloadOptions options)
Downloaded artifact file can be accessed using ArtifactDownloadReport.getLocalFile()
.
It is possible to track the progression of the download using classical ivy progress monitoring feature (see addTransferListener).
artifact
- the artifact to downloadoptions
- DownloadOptionsdownload(ArtifactOrigin, DownloadOptions)
public ArtifactOrigin locate(Artifact artifact)
ArtifactOrigin
in other cases.artifact
- the artifact to locate.ArtifactOrigin.isUnknown(ArtifactOrigin)
to check if the artifact has
actually been located.public ArtifactDownloadReport download(ArtifactOrigin origin, DownloadOptions options)
Not used internally, useful especially for IDE plugins needing to download artifact one by one (for source or javadoc artifact, for instance).
Materialized artifact file can be accessed using
ArtifactDownloadReport.getLocalFile()
.
It is possible to track the progression of the download using classical ivy progress monitoring feature (see addTransferListener).
origin
- the artifact origin to materializeoptions
- DownloadOptionsdownload(Artifact, DownloadOptions)
,
locate(Artifact)
public IvyNode[] getDependencies(java.net.URL ivySource, ResolveOptions options) throws java.text.ParseException, java.io.IOException
ivySource
- url of the ivy file to use for dependency resolvingoptions
- dittojava.text.ParseException
- if a parsing problem occurred in the ivy filejava.io.IOException
- if an IO problem was raised during ivy file parsingpublic IvyNode[] getDependencies(ModuleDescriptor md, ResolveOptions options, ResolveReport report)
The IvyNode
s are ordered from the most dependent to the less dependent, so that
an IvyNode is always found in the list after all IvyNode depending directly on it.
md
- the descriptor of the module for which we want to get dependencies - must not be
nulloptions
- the resolve options to use to resolve the dependenciesreport
- a resolve report to fill during resolution - may be nullpublic ResolvedModuleRevision findModule(ModuleRevisionId id, ResolveOptions options)
public DependencyDescriptor mediate(DependencyDescriptor dd, ResolveOptions options)
The mediated dependency descriptor must return the actually requested module revision id when
the method DependencyDescriptor.getDependencyRevisionId()
is called.
dd
- the dependency descriptor for which the requested module revision id should be
returnedoptions
- the resolve options to useDependencyDescriptor
.public EventManager getEventManager()
public ResolveEngineSettings getSettings()
public SortEngine getSortEngine()
Copyright ©2007-2024 The Apache Software Foundation, Licensed under Apache License, Version 2.0.