Top Description Methods
groovy.lang

public @Interface GrabResolver

extends Annotation
Annotations
@Retention:SOURCE
@Target:CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PARAMETER, TYPE
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Used to add a repository for resolving Grape dependencies.

For example:

@GrabResolver(name='restlet.org', root='http://maven.restlet.org')
@Grab(group='org.restlet', module='org.restlet', version='1.1.6')
class MyRestlet extends org.restlet.Restlet {
  // ...
}
By default, the Grapes subsystem uses an Ivy chained resolver. Each resolver added using @GrabResolver is appended to the chain. By default, the grape subsystem is shared globally, so added resolvers will become available for any subsequent grab calls. Dependency resolution follows Ivy's artifact resolution which tries to resolve artifacts in the order specified in the chain of resolvers.

Further information about customising grape behavior can be found on the Grape documentation page: http://groovy-lang.org/grape.html.

Method Summary

Modifier and TypeMethod and Description
public boolean
initClass()

By default, when a @GrabResolver annotation is used, a Grape.addResolver() call is added to the static initializers of the class the annotatable node appears in. If you wish to disable this, add initClass=false to the annotation.

public boolean
m2Compatible()

Defaults to Maven2 compatibility.

public String
name()

A meaningful name for a repo containing the grape/artifact.

public String
root()

The URL for a repo containing the grape/artifact.

public String
value()

Allows a shorthand form which sets the name and root to this value.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

initClassback to summary
public boolean initClass()

By default, when a @GrabResolver annotation is used, a Grape.addResolver() call is added to the static initializers of the class the annotatable node appears in. If you wish to disable this, add initClass=false to the annotation.

m2Compatibleback to summary
public boolean m2Compatible()

Defaults to Maven2 compatibility. Set false for Ivy only compatibility.

nameback to summary
public String name()

A meaningful name for a repo containing the grape/artifact. A non-empty value is required unless value() is used.

rootback to summary
public String root()

The URL for a repo containing the grape/artifact. A non-empty value is required unless value() is used.

valueback to summary
public String value()

Allows a shorthand form which sets the name and root to this value. Must not be used if name() or root() is non-empty.