Port of sbt/zinc#441 to sbt/sbt 1.0.x

This commit is contained in:
Antonio Cunei 2017-11-16 15:09:25 +01:00
parent 8fe38d4a5a
commit 43a976d42c
1 changed files with 2 additions and 0 deletions

View File

@ -108,6 +108,8 @@ object Scripted {
prescripted: File => Unit,
launchOpts: Seq[String]): Unit = {
System.err.println(s"About to run tests: ${args.mkString("\n * ", "\n * ", "\n")}")
// Force Log4J to not use a thread context classloader otherwise it throws a CCE
sys.props(org.apache.logging.log4j.util.LoaderUtil.IGNORE_TCCL_PROPERTY) = "true"
val noJLine = new classpath.FilteredLoader(scriptedSbtInstance.loader, "jline." :: Nil)
val loader = classpath.ClasspathUtilities.toLoader(scriptedSbtClasspath.files, noJLine)
val bridgeClass = Class.forName("sbt.test.ScriptedRunner", true, loader)