Skip to content

Instantly share code, notes, and snippets.

@rgorsuch
Forked from jessitron/gist:8376139
Created July 31, 2015 13:03
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save rgorsuch/b404c658551a6a8aeb35 to your computer and use it in GitHub Desktop.
Save rgorsuch/b404c658551a6a8aeb35 to your computer and use it in GitHub Desktop.
scala: print all URLs on classpath
def urlses(cl: ClassLoader): Array[java.net.URL] = cl match {
case null => Array()
case u: java.net.URLClassLoader => u.getURLs() ++ urlses(cl.getParent)
case _ => urlses(cl.getParent)
}
val urls = urlses(getClass.getClassLoader)
println(urls.filterNot(_.toString.contains("ivy")).mkString("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment