|
Groovy 1.7.0 | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||
java.lang.Objectgroovy.lang.Grab
@Retention(RetentionPolicy.SOURCE)
@Target({
ElementType.CONSTRUCTOR,
ElementType.FIELD,
ElementType.LOCAL_VARIABLE,
ElementType.METHOD,
ElementType.PARAMETER,
ElementType.TYPE})
@interface Grab
Used to grab the referenced artifact and its dependencies and make it available on the Classpath.
Some examples:
@Grab(group='commons-lang', module='commons-lang', version='2.4')
import org.apache.commons.lang.WordUtils
println "Hello ${WordUtils.capitalize('world')}"
Or using the compact Gradle-inspired syntax:
@Grab('commons-lang:commons-lang:2.4')
import org.apache.commons.lang.WordUtils
println "Hello ${WordUtils.capitalize('world')}"
or the same thing again using the Ivy-inspired syntax variant:
@Grab('commons-lang#commons-lang;2.4')
import org.apache.commons.lang.WordUtils
println "Hello ${WordUtils.capitalize('world')}"
| Required Element Summary | |
|---|---|
String |
module
The module or artifact, e.g.: "ant-junit" |
String |
version
The revision or version, e.g.: "1.7.1" |
| Optional Element Summary | |
|---|---|
String |
classifier
The classifier if in use, e.g.: "jdk14" |
String |
conf
The configuration if in use (normally only used by internal ivy repositories). |
String |
ext
The extension of the artifact (normally safe to leave at default value of "jar") |
String |
group
The organisation or group, e.g.: "org.apache.ant" |
boolean |
initClass
By default, when a { to the static initializers of the class the annotatable node appears in. |
boolean |
transitive
Set to false if you don't want transitive dependencies also to be downloaded. |
String |
value
Allows a more compact convenience format in one of two formats. |
| Method Summary |
|---|
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
| Element Detail |
|---|
String classifier
String conf
String ext
String group
boolean initClass
String module
boolean transitive
String value
String version
Copyright © 2003-2009 The Codehaus. All rights reserved.