Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.getClass().classLoader.rootLoader.addURL(new File("file.jar").toURL())
- #!/bin/bash
- //usr/bin/env groovy -cp extra.jar:spring.jar:etc.jar -d -Dlog4j.configuration=file:/etc/myapp/log4j.xml "$0" $@; exit $?
- import org.springframework.class.from.jar
- //other groovy code
- println 'Hello'
- @Grab(group='com.google.collections', module='google-collections', version='1.0')
- #!/bin/bash
- //bin/true && OPTS="-cp blah.jar -Dmyopt=value"
- //bin/true && OPTS="$OPTS -Dmoreopts=value2"
- //usr/bin/env groovy $OPTS "$0" $@; exit $?
- println "inside my groovy script"
- // printEmployees.groovy
- this.class.classLoader.rootLoader.addURL(
- new URL("file:///C:/app/Dustin/product/11.1.0/db_1/jdbc/lib/ojdbc6.jar"))
- import groovy.sql.Sql
- sql = Sql.newInstance("jdbc:oracle:thin:@localhost:1521:orcl", "hr", "hr",
- "oracle.jdbc.pool.OracleDataSource")
- sql.eachRow("SELECT employee_id, last_name, first_name FROM employees")
- {
- println "The employee's name is ${it.first_name} ${it.last_name}."
- }
- #!/bin/bash
- // 2>/dev/null; SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
- // 2>/dev/null; OPTS="-cp $SCRIPT_DIR/lib/extra.jar:$SCRIPT_DIR/lib/spring.jar"
- // 2>/dev/null; OPTS="$OPTS -d"
- // 2>/dev/null; OPTS="$OPTS -Dlog4j.configuration=file:/etc/myapp/log4j.xml"
- // 2>/dev/null; exec groovy $OPTS "$0" "$@"; exit $?
- import org.springframework.class.from.jar
- //other groovy code
- println 'Hello'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement