this script SetupGroovyLib.groovy provide the following:

groovy SetupGroovyLib.groovy -h

Usage SetupGroovyLib jarname [jarname...]
  The jarname is in format of Maven2 artifacts groupId:artifactId:version name.
  You may use site like to help you find the jarname.
  This script default arguments to:
  These jars will allow you to send emails and access to MySQL database!

NOTE: If you are using groovyConsole, you will need to restart it as it won't pick up any new jar added to ~/.groovy/lib automatically.

See also Installing or Update Groovy Automatically

More examples

Using commons-lang

Run groovy SetupGroovyLib.groovy commons-lang:commons-lang:2.3
Now try out:

import org.apache.commons.lang.*
StringUtils.splitByWholeSeparator("aXXbXXc", "XX")