Skip to content

Instantly share code, notes, and snippets.

@redsk
redsk / gist:fe7effd83570d2deb0744fcc399c4331
Created August 16, 2018 14:25 — forked from rgorsuch/gist:b404c658551a6a8aeb35
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"))