Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sbt 0.13插件依赖项和scala-reflect.jar版本冲突_Scala_Sbt - Fatal编程技术网

Sbt 0.13插件依赖项和scala-reflect.jar版本冲突

Sbt 0.13插件依赖项和scala-reflect.jar版本冲突,scala,sbt,Scala,Sbt,在为sbt 0.13构建插件时,构建任何库依赖项(插件)所依据的scala 2.10版本是否重要 目前,我的插件依赖于基于scala 2.10.2构建的库。这对于单个构建很好,但是当一个构建(a)通过ProjectRef依赖于另一个构建(B)时,我发现projectb中build指令的sbt编译失败。sbt似乎正在使用2.10.2来构建指令文件,但正在加载scala-reflect-2.10.0.jar(从sbt调试回溯,在调用带有参数的scala编译器(编译器接口)打印到屏幕上之后) 如果我自

在为sbt 0.13构建插件时,构建任何库依赖项(插件)所依据的scala 2.10版本是否重要

目前,我的插件依赖于基于scala 2.10.2构建的库。这对于单个构建很好,但是当一个构建(a)通过ProjectRef依赖于另一个构建(B)时,我发现projectb中build指令的sbt编译失败。sbt似乎正在使用2.10.2来构建指令文件,但正在加载
scala-reflect-2.10.0.jar
(从sbt调试回溯,在
调用带有参数的scala编译器(编译器接口)
打印到屏幕上之后)

如果我自己构建被引用的项目(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。

您是否进行了交叉编译?比如说2.9?我不是交叉编译。在这种情况下,插件是为了获得SBT来构建本机C++项目,本质上是使用SBT作为构建工具构建工具包,然后编写GCC、CLAN等()@ MathWaveWror,至少我认为我不是交叉编译。您的意思是在sbt指令的构建时,还是在插件依赖的库中,或者使用sbt和插件交叉编译scala?谢谢标记。这很有帮助。因此,如果我根据2.10.2构建所有的输入依赖项,它应该都能工作。如果它不表示我可能从ivy/maven那里得到了一些东西,它是根据2.10.0/1构建的?是的,可能。如果你有一个测试用例,它将有助于找出具体的问题。事实上,我认为我是个白痴。一切从头开始,问题就解决了。我道歉。结束问题。