我正在尝试运行jenkins工作,但由于:java.lang.RuntimeException: Missing scala-library.jar
失败
运行此行时:
/usr/lib/jvm/java-1.8.0/bin/java -Xmx4250M -Dsbt.log.noformat=true -jar /tmp/jenkins/slaves/build-slave-cb996aa/tools/org.jvnet.hudson.plugins.SbtPluginBuilder_SbtInstallation/default/bin/sbt-launch.jar 'set credentials += Credentials("Artifactory Realm", $ARTIFACTORY_HOST, $USER, $PASSWORD)' assembly
从我自己的计算机上运行或从root运行时,它运行正常(从jFrog获取工件,编译,运行测试并打包jar),但从用户jenkins
运行时它失败。
我发现从root运行时,它会在路径/root/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.11/scala-library-2.11.11.jar
我正在使用sbt.version = 0.13.8
和scalaVersion := "2.11.11"
我显然不希望jenkins工作使用root工作,我们都知道这不对。
完整的堆栈是:
java.lang.RuntimeException: Missing scala-library.jar
at scala.sys.package$.error(package.scala:27)
at sbt.Defaults$$anonfun$scalaInstanceFromUpdate$1$$anonfun$file$1$1.apply(Defaults.scala:382)
at sbt.Defaults$$anonfun$scalaInstanceFromUpdate$1$$anonfun$file$1$1.apply(Defaults.scala:382)
at scala.Option.getOrElse(Option.scala:120)
at sbt.Defaults$$anonfun$scalaInstanceFromUpdate$1.file$1(Defaults.scala:382)
at sbt.Defaults$$anonfun$scalaInstanceFromUpdate$1.apply(Defaults.scala:384)
at sbt.Defaults$$anonfun$scalaInstanceFromUpdate$1.apply(Defaults.scala:374)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[error] (*:scalaInstance) Missing scala-library.jar
谢谢!