Griffon 1.2.0

org.codehaus.griffon.resolve
[Java] Class AbstractIvyDependencyManager

java.lang.Object
  org.codehaus.griffon.resolve.AbstractIvyDependencyManager

public abstract class AbstractIvyDependencyManager

Base class for IvyDependencyManager with some logic implemented in Java.

Authors:
Graeme Rocher (Grails 1.3)


Field Summary
static List ALL_CONFIGURATIONS

static Configuration BUILD_CONFIGURATION

static Configuration COMPILE_CONFIGURATION

static Configuration DOCS_CONFIGURATION

static Configuration RUNTIME_CONFIGURATION

static String SNAPSHOT_CHANGING_PATTERN

static Configuration TEST_CONFIGURATION

protected String applicationName

protected String applicationVersion

protected BuildSettings buildSettings

private ChainResolver chainResolver

Map configurationMappings

protected String[] configurationNames

protected Set dependencies

protected Set dependencyDescriptors

protected boolean hasApplicationDependencies

protected boolean includeJavadoc

protected boolean includeSource

protected IvySettings ivySettings

protected Metadata metadata

protected Set metadataRegisteredPluginNames

protected DefaultModuleDescriptor moduleDescriptor

protected Set modules

protected Map orgToDepMap

protected Set pluginDependencyDescriptors

protected Map pluginNameToDescriptorMap

protected boolean readPom

protected Collection usedConfigurations

 
Constructor Summary
AbstractIvyDependencyManager(IvySettings ivySettings, BuildSettings buildSettings, Metadata metadata)

 
Method Summary
private void addDefaultModuleConfigurations(EnhancedDefaultDependencyDescriptor descriptor, String configurationName, boolean pluginDep)

private void addMetadataPluginDependencies(Map plugins)

protected ArtifactId createExcludeArtifactId(String excludeName)

protected ArtifactId createExcludeArtifactId(String excludeName, String group)

ModuleDescriptor createModuleDescriptor()

private void doParseDependencies(Closure definition, String pluginName)

Evaluates the given DSL definition.

String getApplicationName()

String getApplicationVersion()

BuildSettings getBuildSettings()

ChainResolver getChainResolver()

Map getConfigurationMappings()

String[] getConfigurationNames()

Set getDeclaredPluginDependencyDescriptors()

Returns all plugin dependency descriptors that are not transitively included

Set getDependencies()

Obtains a list of dependencies defined in the project

Set getDependencyDescriptors()

Obtains a set of dependency descriptors defined in the project

IvySettings getIvySettings()

Metadata getMetadata()

Set getMetadataRegisteredPluginNames()

DefaultModuleDescriptor getModuleDescriptor()

DependencyDescriptor getPluginDependencyDescriptor(String pluginName)

Obtains a particular DependencyDescriptor by the plugin name

Set getPluginDependencyDescriptors()

Obtains a set of plugin dependency descriptors defined in the project

Set getPluginDependencyNames()

Obtains a set of plugins this application is dependent onb

Set getPluginExcludes(String plugin)

boolean getReadPom()

Collection getUsedConfigurations()

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(String group, String name)

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

private boolean isCompileOrRuntimeScope(String scope)

boolean isExcludedFromPlugin(String plugin, String dependencyName)

boolean isExcludedFromPlugin(DependencyDescriptor currentPlugin, ArtifactId dependency)

private boolean isExposedByThisPlugin(EnhancedDefaultDependencyDescriptor descriptor)

boolean isOffline()

boolean isPluginTransitive(String pluginName)

Returns whether a plugin is transitive, ie whether its dependencies are resolved transitively

boolean isPluginTransitivelyIncluded(String pluginName)

Whether the plugin is directly included or a transitive dependency of another plugin

void parseDependencies(Closure definition)

Parses the Ivy DSL definition

void parseDependencies(String pluginName, Closure definition)

Parses dependencies of a plugin.

DependencyDescriptor[] readDependenciesFromPOM()

void registerDependency(String scope, EnhancedDefaultDependencyDescriptor descriptor)

Registers a JAR dependency with the dependency manager.

private void registerDependencyCommon(String scope, EnhancedDefaultDependencyDescriptor descriptor, boolean isPluginDep)

Aspects of registering a dependency common to both plugins and jar dependencies.

void registerPluginDependency(String scope, EnhancedDefaultDependencyDescriptor descriptor)

Registers a plugin dependency (as in Griffon plugin).

private void registerPomDependencies()

private void registerPomDependency(DependencyDescriptor dependencyDescriptor)

private void registerUsedConfigurationIfNecessary(String configurationName)

void setApplicationName(String applicationName)

void setApplicationVersion(String applicationVersion)

void setChainResolver(ChainResolver chainResolver)

void setIncludeJavadoc(boolean includeJavadoc)

void setIncludeSource(boolean includeSource)

void setMetadataRegisteredPluginNames(Set metadataRegisteredPluginNames)

void setModuleDescriptor(DefaultModuleDescriptor moduleDescriptor)

void setReadPom(boolean flag)

void setUsedConfigurations(Collection usedConfigurations)

private boolean shouldIncludeDependency(EnhancedDefaultDependencyDescriptor descriptor)

protected void updateChangingPattern()

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

ALL_CONFIGURATIONS

public static List ALL_CONFIGURATIONS


BUILD_CONFIGURATION

public static Configuration BUILD_CONFIGURATION


COMPILE_CONFIGURATION

public static Configuration COMPILE_CONFIGURATION


DOCS_CONFIGURATION

public static Configuration DOCS_CONFIGURATION


RUNTIME_CONFIGURATION

public static Configuration RUNTIME_CONFIGURATION


SNAPSHOT_CHANGING_PATTERN

public static final String SNAPSHOT_CHANGING_PATTERN


TEST_CONFIGURATION

public static Configuration TEST_CONFIGURATION


applicationName

protected String applicationName


applicationVersion

protected String applicationVersion


buildSettings

protected final BuildSettings buildSettings


chainResolver

private ChainResolver chainResolver


configurationMappings

@SuppressWarnings("unchecked")
Map configurationMappings


configurationNames

protected String[] configurationNames


dependencies

protected Set dependencies


dependencyDescriptors

protected Set dependencyDescriptors


hasApplicationDependencies

protected boolean hasApplicationDependencies


includeJavadoc

protected boolean includeJavadoc


includeSource

protected boolean includeSource


ivySettings

protected final IvySettings ivySettings


metadata

protected final Metadata metadata


metadataRegisteredPluginNames

protected Set metadataRegisteredPluginNames


moduleDescriptor

protected DefaultModuleDescriptor moduleDescriptor


modules

protected Set modules


orgToDepMap

protected Map orgToDepMap


pluginDependencyDescriptors

protected Set pluginDependencyDescriptors


pluginNameToDescriptorMap

protected Map pluginNameToDescriptorMap


readPom

protected boolean readPom


usedConfigurations

protected Collection usedConfigurations


 
Constructor Detail

AbstractIvyDependencyManager

public AbstractIvyDependencyManager(IvySettings ivySettings, BuildSettings buildSettings, Metadata metadata)


 
Method Detail

addDefaultModuleConfigurations

private void addDefaultModuleConfigurations(EnhancedDefaultDependencyDescriptor descriptor, String configurationName, boolean pluginDep)


addMetadataPluginDependencies

private void addMetadataPluginDependencies(Map plugins)


createExcludeArtifactId

protected ArtifactId createExcludeArtifactId(String excludeName)


createExcludeArtifactId

protected ArtifactId createExcludeArtifactId(String excludeName, String group)


createModuleDescriptor

public ModuleDescriptor createModuleDescriptor()


doParseDependencies

private void doParseDependencies(Closure definition, String pluginName)
Evaluates the given DSL definition.

If pluginName is not null, all dependencies will record that they were defined by this plugin.

See Also:
EnhancedDefaultDependencyDescriptor#plugin#plugin


getApplicationName

public String getApplicationName()


getApplicationVersion

public String getApplicationVersion()


getBuildSettings

public BuildSettings getBuildSettings()


getChainResolver

public ChainResolver getChainResolver()


getConfigurationMappings

public Map getConfigurationMappings()


getConfigurationNames

public String[] getConfigurationNames()


getDeclaredPluginDependencyDescriptors

Set getDeclaredPluginDependencyDescriptors()
Returns all plugin dependency descriptors that are not transitively included
Returns:
Declared plugin descriptors


getDependencies

public Set getDependencies()
Obtains a list of dependencies defined in the project


getDependencyDescriptors

Set getDependencyDescriptors()
Obtains a set of dependency descriptors defined in the project


getIvySettings

public IvySettings getIvySettings()


getMetadata

public Metadata getMetadata()


getMetadataRegisteredPluginNames

public Set getMetadataRegisteredPluginNames()


getModuleDescriptor

public DefaultModuleDescriptor getModuleDescriptor()


getPluginDependencyDescriptor

public DependencyDescriptor getPluginDependencyDescriptor(String pluginName)
Obtains a particular DependencyDescriptor by the plugin name
Parameters:
pluginName - The plugin name
Returns:
A DependencyDescriptor or null


getPluginDependencyDescriptors

Set getPluginDependencyDescriptors()
Obtains a set of plugin dependency descriptors defined in the project


getPluginDependencyNames

public Set getPluginDependencyNames()
Obtains a set of plugins this application is dependent onb
Returns:
A set of plugins names


getPluginExcludes

public Set getPluginExcludes(String plugin)


getReadPom

public boolean getReadPom()


getUsedConfigurations

public Collection getUsedConfigurations()


hasApplicationDependencies

public 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(String group, String name)
Tests whether the given group and name are defined in the list of dependencies


isCompileOrRuntimeScope

private boolean isCompileOrRuntimeScope(String scope)


isExcludedFromPlugin

public boolean isExcludedFromPlugin(String plugin, String dependencyName)


isExcludedFromPlugin

public boolean isExcludedFromPlugin(DependencyDescriptor currentPlugin, ArtifactId dependency)


isExposedByThisPlugin

private boolean isExposedByThisPlugin(EnhancedDefaultDependencyDescriptor descriptor)


isOffline

public boolean isOffline()


isPluginTransitive

public boolean isPluginTransitive(String pluginName)
Returns whether a plugin is transitive, ie whether its dependencies are resolved transitively
Parameters:
pluginName - The name of the plugin
Returns:
True if the plugin is transitive


isPluginTransitivelyIncluded

public boolean isPluginTransitivelyIncluded(String pluginName)
Whether the plugin is directly included or a transitive dependency of another plugin
Parameters:
pluginName - The plugin name
Returns:
True if is transitively included


parseDependencies

public void parseDependencies(@SuppressWarnings("rawtypes") Closure definition)
Parses the Ivy DSL definition


parseDependencies

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


readDependenciesFromPOM

public DependencyDescriptor[] readDependenciesFromPOM()


registerDependency

public void registerDependency(String scope, EnhancedDefaultDependencyDescriptor descriptor)
Registers a JAR dependency with the dependency manager.
See Also:
registerPluginDependency(String, EnhancedDefaultDependencyDescriptor)


registerDependencyCommon

private void registerDependencyCommon(String scope, EnhancedDefaultDependencyDescriptor descriptor, boolean isPluginDep)
Aspects of registering a dependency common to both plugins and jar dependencies.


registerPluginDependency

public void registerPluginDependency(String scope, EnhancedDefaultDependencyDescriptor descriptor)
Registers a plugin dependency (as in Griffon plugin).
See Also:
registerDependency(String, EnhancedDefaultDependencyDescriptor)


registerPomDependencies

private void registerPomDependencies()


registerPomDependency

private void registerPomDependency(DependencyDescriptor dependencyDescriptor)


registerUsedConfigurationIfNecessary

private void registerUsedConfigurationIfNecessary(String configurationName)


setApplicationName

public void setApplicationName(String applicationName)


setApplicationVersion

public void setApplicationVersion(String applicationVersion)


setChainResolver

public void setChainResolver(ChainResolver chainResolver)


setIncludeJavadoc

public void setIncludeJavadoc(boolean includeJavadoc)


setIncludeSource

public void setIncludeSource(boolean includeSource)


setMetadataRegisteredPluginNames

public void setMetadataRegisteredPluginNames(Set metadataRegisteredPluginNames)


setModuleDescriptor

public void setModuleDescriptor(DefaultModuleDescriptor moduleDescriptor)


setReadPom

public void setReadPom(boolean flag)


setUsedConfigurations

public void setUsedConfigurations(Collection usedConfigurations)


shouldIncludeDependency

private boolean shouldIncludeDependency(EnhancedDefaultDependencyDescriptor descriptor)


updateChangingPattern

protected void updateChangingPattern()


 

Groovy Documentation