-
-
Save pestilence669/f135d6d0bf6ff08d93f8 to your computer and use it in GitHub Desktop.
scala: print all URLs on classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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