public class IvyDependencies extends Dependencies<IvyModule>
getDependencyDescriptors()
.Modifier | Constructor and Description |
---|---|
protected |
IvyDependencies(File ivyFile,
File artifactsFile,
IvyContainer container)
Parses the Ivy module descriptor, and loads the managed artifacts
database.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addExplicitDependency(String group,
String name,
String version,
boolean force,
boolean transitive)
Adds an explicit dependency.
|
boolean |
excludeDependency(String group,
String name)
Excludes an implicit dependency.
|
void |
freezeVersions()
Sets the required versions of all explicit and implicit dependencies to
the those that were last resolved.
|
Set<Artifact> |
getArtifacts(boolean install,
boolean overwrite,
boolean verify)
Retrieves or installs the artifacts based on currently installed
packages.
|
List<File> |
getClasspaths(boolean includeSystem)
The classpath based on currently installed artifacts.
|
org.apache.ivy.core.module.descriptor.DependencyDescriptor[] |
getDependencyDescriptors()
The Ivy
DependencyDescriptor instances for the explicit
dependencies. |
Modules<IvyModule> |
getModules()
The installed modules (explicit and implicit dependencies), based on the
last
Dependencies.install(boolean, boolean) . |
File |
getResolutionReportFile()
The Ivy resolution report file, from the last
resolve() . |
boolean |
hasExplicitDependency(String group,
String name,
String version)
True if the module is an explicit dependency with a particular version.
|
void |
install(boolean overwrite,
boolean verify)
Installs/upgrades dependencies.
|
boolean |
overrideDependency(String group,
String name,
String version)
Overrides the version of an implicit dependency.
|
boolean |
removeExplicitDependency(String group,
String name)
Revokes an explicit dependency.
|
void |
reset()
Revokes all explicit and implicit dependencies.
|
boolean |
reviseExplicitDependency(String group,
String name,
String newVersion)
Changes the version for an explicit dependency that has already been
specified.
|
getArtifactManager, getArtifacts, getClasspath, getContainer, getPackages, hasExplicitDependency, printDisclaimer, prune, uninstallPackages
protected IvyDependencies(File ivyFile, File artifactsFile, IvyContainer container) throws SincerityException
ivyFile
- The Ivy module descriptor file (usually
"/configuration/sincerity/dependencies.conf")artifactsFile
- The managed artifacts database file (usually
"/configuration/sincerity/artifacts.conf")container
- The containerSincerityException
- In case of an errorpublic org.apache.ivy.core.module.descriptor.DependencyDescriptor[] getDependencyDescriptors()
DependencyDescriptor
instances for the explicit
dependencies.public File getResolutionReportFile()
resolve()
.public boolean hasExplicitDependency(String group, String name, String version)
Dependencies
hasExplicitDependency
in class Dependencies<IvyModule>
group
- The module's groupname
- The module's nameversion
- The module's version or nullpublic Modules<IvyModule> getModules() throws SincerityException
Dependencies
Dependencies.install(boolean, boolean)
.getModules
in class Dependencies<IvyModule>
SincerityException
- In case of an errorpublic Set<Artifact> getArtifacts(boolean install, boolean overwrite, boolean verify) throws SincerityException
Dependencies
getArtifacts
in class Dependencies<IvyModule>
install
- True to allow installation of packagesoverwrite
- True to force overwriting of existing filesverify
- Whether to verify the unpackingSincerityException
- In case of an errorpublic List<File> getClasspaths(boolean includeSystem) throws SincerityException
Dependencies
getClasspaths
in class Dependencies<IvyModule>
includeSystem
- True to include the system classpathSincerityException
- In case of an errorDependencies.getClasspath(boolean)
public void reset() throws SincerityException
Dependencies
Does not resolve; only changes the specification.
reset
in class Dependencies<IvyModule>
SincerityException
- In case of an errorpublic boolean addExplicitDependency(String group, String name, String version, boolean force, boolean transitive) throws SincerityException
Dependencies
Will not add the dependency if it is already specified.
addExplicitDependency
in class Dependencies<IvyModule>
group
- The dependency's groupname
- The dependency's nameversion
- The dependency's versionforce
- Whether to force the dependencytransitive
- Whether to pull in dependencies of the dependencySincerityException
- In case of an errorpublic boolean reviseExplicitDependency(String group, String name, String newVersion) throws SincerityException
Dependencies
reviseExplicitDependency
in class Dependencies<IvyModule>
group
- The dependency's groupname
- The dependency's namenewVersion
- The dependency's new versionSincerityException
- In case of an errorpublic boolean removeExplicitDependency(String group, String name) throws SincerityException
Dependencies
removeExplicitDependency
in class Dependencies<IvyModule>
group
- The dependency's groupname
- The dependency's nameSincerityException
- In case of an errorpublic boolean excludeDependency(String group, String name) throws SincerityException
Dependencies
excludeDependency
in class Dependencies<IvyModule>
group
- The dependency's groupname
- The dependency's nameSincerityException
- In case of an errorpublic boolean overrideDependency(String group, String name, String version) throws SincerityException
Dependencies
overrideDependency
in class Dependencies<IvyModule>
group
- The dependency's groupname
- The dependency's nameversion
- The dependency's versionSincerityException
- In case of an errorpublic void freezeVersions() throws SincerityException
Dependencies
freezeVersions
in class Dependencies<IvyModule>
SincerityException
- In case of an errorpublic void install(boolean overwrite, boolean verify) throws SincerityException
Dependencies
install
in class Dependencies<IvyModule>
overwrite
- True to force overwrite of existing artifact filesverify
- Whether to verify the unpackingSincerityException
- In case of an errorCopyright © 2011-2016 Three Crickets LLC.