Skip to content

Instantly share code, notes, and snippets.

@ansig
Created April 19, 2018 10:48
Show Gist options
  • Save ansig/efb4ab2b2afe673f4cd81974251a37b4 to your computer and use it in GitHub Desktop.
Save ansig/efb4ab2b2afe673f4cd81974251a37b4 to your computer and use it in GitHub Desktop.
Print classpath in Groovy for debugging
def printClassPath(classLoader) {
println "=== ${classLoader} ==="
if (classLoader instanceof java.net.URLClassLoader) {
classLoader.getURLs().each {url->
println "- ${url.toString()}"
}
}
if (classLoader.parent) {
printClassPath(classLoader.parent)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment