Created
January 21, 2016 21:08
-
-
Save dyerrington/ce7b6be5530104fb13a0 to your computer and use it in GitHub Desktop.
Easily print classpath and jar files of loaded classes in scala.
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) | |
urls.filterNot(_.toString.contains("ivy")).foreach(println) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment