Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
none
none
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 http://www.mvnrepository.com to help you find the jarname.
  This script default arguments to:
    javax.activation:activation:1.1
    javax.mail:mail:1.4
    mysql:mysql-connector-java:5.1.5
  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.

More examples

Using commons-lang

{{ groovy SetupGroovyLib.groovy commons-lang:commons-lang:2.3 }}
Now try out:

Code Block
none
none

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