findclasspath task
Description
The
Implementation is based on a chain of responsability pattern.
<ea:findclasspath org="org.codehaus.groovy" module="groovy-all" revision="1.0"/>By default if you do not specify anything inside the findclasspath task, easyant will use the default strategies :
- ProjectDependencyStrategy : will check if the specified dependency is contained as a project dependencies. If there is no exact match it will give a try based on organisation name. If found easyant will use the specified version in the project dependencies.
- BasicConfiguration : will use the specified dependency (declared in findclasspath)
Using additional strategy
You can define (or override) the default behavior and plug your own strategy.By default, EasyAnt came with an additional strategy : environment strategy.
This strategy can be referenced as a nested element of
If you choose to use additionnal strategy you need to define the whole chain (ordered). This allow you to interfer with the two default strategies
Say for example you want to :
- check project dependencies
- if not found check environment variables
- if not found use the specified version in findclasspath argument
<ea:findclasspath org="org.codehaus.groovy" module="groovy-all" revision="1.0">
<project-dependency-strategy/>
<environment-strategy env="GROOVY_HOME"/>
<basic-configuration-strategy/>
</ea:findclasspath>
Arguments
Parameter name | Description | Mandatory |
---|---|---|
pathid | name of the path id to fill | true |
organisation | organisation name to search (used by nested strategies extending BasicConfigurationStrategy) | |
module | module name to search (used by nested strategies extending BasicConfigurationStrategy) | |
revision | revision number to search (used by nested strategies extending BasicConfigurationStrategy) | |
conf | configuration name (used by nested strategies extending BasicConfigurationStrategy) Default: default |
Nested Elements
This task can have nested elements extending org.apache.easyant.tasks.findclasspathAbstractFindClassPathStrategy.By default it comes with three implementation :
Example
Really basic sample :<ea:findclasspath org="org.codehaus.groovy" module="groovy-all" revision="1.0"/>Using nested strategies :
<ea:findclasspath org="org.codehaus.groovy" module="groovy-all" revision="1.0">
<project-dependency-strategy/>
<environment-strategy env="GROOVY_HOME"/>
<basic-configuration-strategy/>
</ea:findclasspath>