Sbt 0.13插件依赖项和scala-reflect.jar版本冲突
发布时间:2020-12-13 20:47:18 所属栏目:百科 来源:网络整理
导读:在为sbt 0.13构建插件时,重要的是 scala 2.10的哪个版本的库依赖项(插件的)是针对什么构建的? 目前我的插件依赖于针对scala 2.10.2构建的库.这适用于单个构建,但是当构建(A)依赖于另一个构建(B)时,通过ProjectRef,我发现项目B中构建指令的sbt编译失败.似乎
在为sbt 0.13构建插件时,重要的是
scala 2.10的哪个版本的库依赖项(插件的)是针对什么构建的?
目前我的插件依赖于针对scala 2.10.2构建的库.这适用于单个构建,但是当构建(A)依赖于另一个构建(B)时,通过ProjectRef,我发现项目B中构建指令的sbt编译失败.似乎是sbt正在使用2.10.2来构建指令文件,但是正在加载scala-reflect-2.10.0.jar(来自sbt调试回溯,在调用带有参数的Scala编译器(CompilerInterface)之后打印到屏幕). 如果我自己构建引用的项目(B),指令文件的构建成功,但再次查看正在加载的jar,我看到scala-2.10.2 / lib / scala-reflect.jar被引用. 失败时的错误消息是: [error] error while loading MacroValue,Missing dependency 'bad symbolic reference. A signature in MacroValue.class refers to term annotations [error] in package scala.reflect.internal which is not available. [error] It may be completely missing from the current classpath,or the version on [error] the classpath might be incompatible with the version used when compiling MacroValue.class.',required by /home/alex.wilson/.ivy2/cache/org.scala-sbt/main-settings/jars/main-settings-0.13.0.jar(sbt/std/MacroValue.class) [error] error while loading InputEvaluated,Missing dependency 'bad symbolic reference. A signature in InputEvaluated.class refers to term annotations [error] in package scala.reflect.internal which is not available. [error] It may be completely missing from the current classpath,or the version on [error] the classpath might be incompatible with the version used when compiling InputEvaluated.class.',required by /home/alex.wilson/.ivy2/cache/org.scala-sbt/main-settings/jars/main-settings-0.13.0.jar(sbt/std/InputEvaluated.class) [error] error while loading ParserInput,Missing dependency 'bad symbolic reference. A signature in ParserInput.class refers to term annotations [error] in package scala.reflect.internal which is not available. [error] It may be completely missing from the current classpath,or the version on [error] the classpath might be incompatible with the version used when compiling ParserInput.class.',required by /home/alex.wilson/.ivy2/cache/org.scala-sbt/main-settings/jars/main-settings-0.13.0.jar(sbt/std/ParserInput.class) [error] three errors found 我可以重建我的插件,以便它依赖于根据需要构建的2.10.0库.但我不确定这是否是正确的方法并且会有所帮助.任何建议将不胜感激.
sbt 0.13.0需要Scala 2.10.2或更高版本.错误消息表示在2.10.2中引入了缺少的类.因此,正如您所提到的,类路径似乎包含较旧的Scala版本.通常,如果您未设置scalaVersion,则应在sbt插件的类路径中包含正确版本的Scala.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |