Groovy Documentation

org.codehaus.groovy.grails.resolve
[Groovy] Class IvyDependencyManager

java.lang.Object
  org.codehaus.groovy.grails.resolve.AbstractIvyDependencyManager
      org.codehaus.groovy.grails.resolve.IvyDependencyManager
All Implemented Interfaces:
DependencyDefinitionParser, DependencyResolver

class IvyDependencyManager
extends AbstractIvyDependencyManager

Implementation that uses Apache Ivy under the hood.

Authors:
Graeme Rocher
Since:
1.2


Field Summary
 
Fields inherited from class AbstractIvyDependencyManager
ALL_CONFIGURATIONS, BUILD_CONFIGURATION, COMPILE_CONFIGURATION, DOCS_CONFIGURATION, PROVIDED_CONFIGURATION, RUNTIME_CONFIGURATION, TEST_CONFIGURATION, applicationName, applicationVersion, configurationNames, dependencies, dependencyDescriptors, metadataRegisteredPluginNames, modules, orgToDepMap, pluginDependencyDescriptors, pluginDependencyNames, pluginNameToDescriptorMap
 
Property Summary
BuildSettings buildSettings

ChainResolver chainResolver

java.util.Collection configuredPlugins

DefaultDependencyDescriptor currentDependencyDescriptor

boolean defaultDependenciesProvided

boolean inheritRepositories

boolean inheritsAll

IvySettings ivySettings

MessageLogger logger

Metadata metadata

DefaultModuleDescriptor moduleDescriptor

java.util.Collection moduleExcludes

boolean pluginsOnly

boolean readPom

java.util.Collection repositoryData

ResolveEngine resolveEngine

boolean resolveErrors

TransferListener transferListener

java.util.Collection usedConfigurations

 
Constructor Summary
IvyDependencyManager(java.lang.String applicationName, java.lang.String applicationVersion, BuildSettings settings = null, Metadata metadata = null)

Creates a new IvyDependencyManager instance

 
Method Summary
void addPluginDependency(java.lang.String pluginName, java.util.Map args)

For usages such as addPluginDependency("foo", [group:"junit", name:"junit", version:"4.8.1"])

java.lang.Object configureDependencyDescriptor(EnhancedDefaultDependencyDescriptor dependencyDescriptor, java.lang.String scope, groovy.lang.Closure dependencyConfigurer = null, boolean pluginMode = false)

java.util.Set getApplicationDependencyDescriptors(java.lang.String scope = null)

Returns all of the dependency descriptors for dependencies of the application and not those inherited from frameworks or plugins

boolean getBooleanValue(java.lang.Object dependency, java.lang.String name)

ChainResolver getChainResolver()

@return The current chain resolver

static groovy.lang.Closure getDefaultDependencies(java.lang.String grailsVersion)

Obtains the default dependency definitions for the given Grails version

java.util.Set getEffectivePluginDependencyDescriptors()

The plugin dependencies excluding non-exported transitive deps and collapsed to the highest version of each dependency.

java.util.Set getExportedDependencyDescriptors(java.lang.String scope = null)

Returns all the dependency descriptors for dependencies of a plugin that have been exported for use in the application

MessageLogger getLogger()

java.util.Set getModuleRevisionIds(java.lang.String org)

boolean hasApplicationDependencies()

Returns true if the application has any dependencies that are not inherited from the framework or other plugins

boolean hasDependency(ModuleId mid)

Tests whether the given ModuleId is defined in the list of dependencies

boolean hasDependency(java.lang.String group, java.lang.String name)

Tests whether the given group and name are defined in the list of dependencies

boolean isExcluded(java.lang.String name)

boolean isPluginConfiguredByApplication(java.lang.String name)

IvyNode[] listDependencies(java.lang.String conf = null)

Lists all known dependencies for the given configuration name (defaults to all dependencies)

ResolveReport loadDependencies(java.lang.String conf = '')

Similar to resolveDependencies, but will load the resolved dependencies into the application RootLoader if it exists

void parseDependencies(groovy.lang.Closure definition)

Parses the Ivy DSL definition

void parseDependencies(java.lang.String pluginName, groovy.lang.Closure definition)

Parses dependencies of a plugin

java.util.List readDependenciesFromPOM()

void resetGrailsPluginsResolver()

Resets the Grails plugin resolver if it is used

java.util.List resolveApplicationDependencies(java.lang.String conf = '')

Resolves only application dependencies and returns a list of the resolves JAR files

ResolveReport resolveDependencies(Configuration conf)

ResolveReport resolveDependencies(java.lang.String conf)

Performs a resolve of all dependencies for the given configuration, potentially going out to the internet to download jars if they are not found locally

ResolveReport resolveDependencies()

Performs a resolve of all dependencies, potentially going out to the internet to download jars if they are not found locally

java.util.List resolveExportedDependencies(java.lang.String conf = '')

Resolves only plugin dependencies that should be exported to the application

ResolveReport resolvePluginDependencies(java.lang.String conf = '', java.util.Map args = [:])

Performs a resolve of declared plugin dependencies (zip files containing plugin distributions)

void serialize(java.lang.Object builder, boolean createRoot = true)

Serializes the parsed dependencies using the given builder.

void setChainResolver(ChainResolver resolver)

Allows settings an alternative chain resolver to be used

void setLogger(MessageLogger logger)

Sets the default message logger used by Ivy

 
Methods inherited from class AbstractIvyDependencyManager
addDependency, addDependencyDescriptor, createExcludeArtifactId, createExcludeArtifactId, createModuleDescriptor, getApplicationName, getApplicationVersion, getConfigurationMappings, getConfigurationNames, getDependencies, getMetadataRegisteredPluginNames, getPluginDependencyDescriptor, getPluginDependencyNames, getPluginExcludes, isExcludedFromPlugin, isExcludedFromPlugin, isPluginTransitive, setApplicationName, setApplicationVersion, setMetadataRegisteredPluginNames
 

Property Detail

buildSettings

BuildSettings buildSettings


chainResolver

ChainResolver chainResolver


configuredPlugins

java.util.Collection configuredPlugins


currentDependencyDescriptor

DefaultDependencyDescriptor currentDependencyDescriptor


defaultDependenciesProvided

boolean defaultDependenciesProvided


inheritRepositories

boolean inheritRepositories


inheritsAll

boolean inheritsAll


ivySettings

IvySettings ivySettings


logger

MessageLogger logger


metadata

Metadata metadata


moduleDescriptor

DefaultModuleDescriptor moduleDescriptor


moduleExcludes

java.util.Collection moduleExcludes


pluginsOnly

boolean pluginsOnly


readPom

boolean readPom


repositoryData

java.util.Collection repositoryData


resolveEngine

ResolveEngine resolveEngine


resolveErrors

boolean resolveErrors


transferListener

TransferListener transferListener


usedConfigurations

java.util.Collection usedConfigurations


 
Constructor Detail

IvyDependencyManager

IvyDependencyManager(java.lang.String applicationName, java.lang.String applicationVersion, BuildSettings settings = null, Metadata metadata = null)
Creates a new IvyDependencyManager instance


 
Method Detail

addPluginDependency

void addPluginDependency(java.lang.String pluginName, java.util.Map args)
For usages such as addPluginDependency("foo", [group:"junit", name:"junit", version:"4.8.1"]) This method is designed to be used by the internal framework and plugins and not be end users. The idea is that plugins can provide dependencies at runtime which are then inherited by the user's dependency configuration A user can however override a plugin's dependencies inside the dependency resolution DSL


configureDependencyDescriptor

java.lang.Object configureDependencyDescriptor(EnhancedDefaultDependencyDescriptor dependencyDescriptor, java.lang.String scope, groovy.lang.Closure dependencyConfigurer = null, boolean pluginMode = false)


getApplicationDependencyDescriptors

java.util.Set getApplicationDependencyDescriptors(java.lang.String scope = null)
Returns all of the dependency descriptors for dependencies of the application and not those inherited from frameworks or plugins


getBooleanValue

boolean getBooleanValue(java.lang.Object dependency, java.lang.String name)


getChainResolver

ChainResolver getChainResolver()
Returns:
The current chain resolver


getDefaultDependencies

static groovy.lang.Closure getDefaultDependencies(java.lang.String grailsVersion)
Obtains the default dependency definitions for the given Grails version


getEffectivePluginDependencyDescriptors

java.util.Set getEffectivePluginDependencyDescriptors()
The plugin dependencies excluding non-exported transitive deps and collapsed to the highest version of each dependency.


getExportedDependencyDescriptors

java.util.Set getExportedDependencyDescriptors(java.lang.String scope = null)
Returns all the dependency descriptors for dependencies of a plugin that have been exported for use in the application


getLogger

MessageLogger getLogger()


getModuleRevisionIds

java.util.Set getModuleRevisionIds(java.lang.String org)


hasApplicationDependencies

boolean hasApplicationDependencies()
Returns true if the application has any dependencies that are not inherited from the framework or other plugins


hasDependency

boolean hasDependency(ModuleId mid)
Tests whether the given ModuleId is defined in the list of dependencies


hasDependency

boolean hasDependency(java.lang.String group, java.lang.String name)
Tests whether the given group and name are defined in the list of dependencies


isExcluded

boolean isExcluded(java.lang.String name)


isPluginConfiguredByApplication

boolean isPluginConfiguredByApplication(java.lang.String name)


listDependencies

IvyNode[] listDependencies(java.lang.String conf = null)
Lists all known dependencies for the given configuration name (defaults to all dependencies)


loadDependencies

ResolveReport loadDependencies(java.lang.String conf = '')
Similar to resolveDependencies, but will load the resolved dependencies into the application RootLoader if it exists
throws:
IllegalStateException If no RootLoader exists
Returns:
The ResolveReport


parseDependencies

void parseDependencies(groovy.lang.Closure definition)
Parses the Ivy DSL definition


parseDependencies

void parseDependencies(java.lang.String pluginName, groovy.lang.Closure definition)
Parses dependencies of a plugin
Parameters:
pluginName - the name of the plugin
definition - the Ivy DSL definition


readDependenciesFromPOM

java.util.List readDependenciesFromPOM()


resetGrailsPluginsResolver

void resetGrailsPluginsResolver()
Resets the Grails plugin resolver if it is used


resolveApplicationDependencies

java.util.List resolveApplicationDependencies(java.lang.String conf = '')
Resolves only application dependencies and returns a list of the resolves JAR files


resolveDependencies

ResolveReport resolveDependencies(Configuration conf)


resolveDependencies

ResolveReport resolveDependencies(java.lang.String conf)
Performs a resolve of all dependencies for the given configuration, potentially going out to the internet to download jars if they are not found locally


resolveDependencies

ResolveReport resolveDependencies()
Performs a resolve of all dependencies, potentially going out to the internet to download jars if they are not found locally


resolveExportedDependencies

java.util.List resolveExportedDependencies(java.lang.String conf = '')
Resolves only plugin dependencies that should be exported to the application


resolvePluginDependencies

ResolveReport resolvePluginDependencies(java.lang.String conf = '', java.util.Map args = [:])
Performs a resolve of declared plugin dependencies (zip files containing plugin distributions)


serialize

void serialize(java.lang.Object builder, boolean createRoot = true)
Serializes the parsed dependencies using the given builder.
Parameters:
builder - A builder such as groovy.xml.MarkupBuilder


setChainResolver

void setChainResolver(ChainResolver resolver)
Allows settings an alternative chain resolver to be used
Parameters:
resolver - The resolver to be used


setLogger

void setLogger(MessageLogger logger)
Sets the default message logger used by Ivy
Parameters:
logger


 

Groovy Documentation