diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-08 19:38:27 -0500 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-08 20:09:00 -0500 |
commit | 56a8c4e83c976aa841c20095efa8df652b0261ad (patch) | |
tree | 8f1a7f18bbf6a256cd8067f958693f176b446a33 /stage1/resolver.scala | |
parent | 1cac1cae6f48664188e3306eda70ce36fa2a5c0b (diff) | |
download | cbt-56a8c4e83c976aa841c20095efa8df652b0261ad.tar.gz cbt-56a8c4e83c976aa841c20095efa8df652b0261ad.tar.bz2 cbt-56a8c4e83c976aa841c20095efa8df652b0261ad.zip |
fix duplicate classloader. one is enough
Diffstat (limited to 'stage1/resolver.scala')
-rw-r--r-- | stage1/resolver.scala | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/stage1/resolver.scala b/stage1/resolver.scala index 9b3276b..fae5e9d 100644 --- a/stage1/resolver.scala +++ b/stage1/resolver.scala @@ -45,21 +45,20 @@ abstract class Dependency{ _.right.toOption.map(_.exportedClasspath) ) ) - val mavenClassPath = ClassPath.flatten( + val cachedClassPath = ClassPath.flatten( transitiveClassPath.flatMap( _.left.toOption ).par.map(_.exportedClasspath).seq.sortBy(_.string) ) + if(cacheDependencyClassLoader){ new URLClassLoader( exportedClasspath ++ buildClassPath, - ClassLoaderCache.classLoader( - mavenClassPath, new URLClassLoader( mavenClassPath, ClassLoader.getSystemClassLoader ) - ) + ClassLoaderCache.get( cachedClassPath ) ) } else { new URLClassLoader( - exportedClasspath ++ buildClassPath ++ mavenClassPath, ClassLoader.getSystemClassLoader + exportedClasspath ++ buildClassPath ++ cachedClassPath, ClassLoader.getSystemClassLoader ) } } |