public class DependencyCustomizer extends Object
Grapes to actually resolve dependencies. This class provides a fluent API for
conditionally adding dependencies. For example:
dependencies.ifMissing("com.corp.SomeClass").add(group, module, version).| Modifier | Constructor and Description |
|---|---|
protected |
DependencyCustomizer(DependencyCustomizer parent)
Create a new nested
DependencyCustomizer. |
|
DependencyCustomizer(groovy.lang.GroovyClassLoader loader)
Create a new
DependencyCustomizer instance. |
| Modifier and Type | Method and Description |
|---|---|
DependencyCustomizer |
add(Map<String,Object>... dependencies)
Add a dependencies.
|
DependencyCustomizer |
add(String group,
String module,
String version)
Add a single dependencies.
|
DependencyCustomizer |
add(String group,
String module,
String version,
boolean transitive)
Add a single dependencies.
|
protected boolean |
canAdd()
Strategy called to test if dependencies can be added.
|
protected boolean |
contains(String group,
String module) |
String |
getProperty(String key) |
String |
getProperty(String key,
String defaultValue) |
DependencyCustomizer |
ifAllMissingClasses(String... classNames)
Create a nested
DependencyCustomizer that only applies if all of the
specified class names are not on the class path. |
DependencyCustomizer |
ifAllResourcesPresent(String... paths)
Create a nested
DependencyCustomizer that only applies if the specified
paths are on the class path. |
DependencyCustomizer |
ifAnyMissingClasses(String... classNames)
Create a nested
DependencyCustomizer that only applies if any of the
specified class names are not on the class path. |
DependencyCustomizer |
ifAnyResourcesPresent(String... paths)
Create a nested
DependencyCustomizer that only applies at least one of the
specified paths is on the class path. |
DependencyCustomizer |
ifNotAdded(String group,
String module)
Create a nested
DependencyCustomizer that only applies the specified one
was not yet added. |
public DependencyCustomizer(groovy.lang.GroovyClassLoader loader)
DependencyCustomizer instance. The call() method must
be used to actually resolve dependencies.loader - protected DependencyCustomizer(DependencyCustomizer parent)
DependencyCustomizer.parent - public DependencyCustomizer ifAnyMissingClasses(String... classNames)
DependencyCustomizer that only applies if any of the
specified class names are not on the class path.classNames - the class names to testDependencyCustomizerpublic DependencyCustomizer ifAllMissingClasses(String... classNames)
DependencyCustomizer that only applies if all of the
specified class names are not on the class path.classNames - the class names to testDependencyCustomizerpublic DependencyCustomizer ifAllResourcesPresent(String... paths)
DependencyCustomizer that only applies if the specified
paths are on the class path.paths - the paths to testDependencyCustomizerpublic DependencyCustomizer ifAnyResourcesPresent(String... paths)
DependencyCustomizer that only applies at least one of the
specified paths is on the class path.paths - the paths to testDependencyCustomizerpublic DependencyCustomizer ifNotAdded(String group, String module)
DependencyCustomizer that only applies the specified one
was not yet added.DependencyCustomizerprotected boolean contains(String group, String module)
group - the group IDmodule - the module IDpublic DependencyCustomizer add(String group, String module, String version)
group - the group IDmodule - the module IDversion - the versionDependencyCustomizer for continued usepublic DependencyCustomizer add(String group, String module, String version, boolean transitive)
group - the group IDmodule - the module IDversion - the versionDependencyCustomizer for continued usepublic DependencyCustomizer add(Map<String,Object>... dependencies)
dependencies - a map of the dependencies to add.DependencyCustomizer for continued useprotected boolean canAdd()
Copyright © 2013. All Rights Reserved.