Bash or PHP script has a function that returns the directory path of the current script file.
$my_dir=dirname(__FILE__);
Groovy script lacks such a capability but an alternative is available by calling
def my_dir = new File(getClass().protectionDomain.codeSource.location.path).parent
Thank you. Worked perfect in my config.groovy to set grails.plugin.reveng.jdbcDriverJarPath.
ReplyDeletedef my_dir = new File(getClass().protectionDomain.codeSource.location.path).parent
grails.plugin.reveng.jdbcDriverJarPath = "$my_dir/../lib/ojdbc6.jar"
throws
ReplyDeleteCaught: java.net.MalformedURLException: unknown protocol: c
java.net.MalformedURLException: unknown protocol: c
when any folder in the path has spaces