sbt没有找到托管依赖的类

时间:2017-05-07 14:36:19

标签: scala sbt jepp

我尝试使用sbt:https://mvnrepository.com/artifact/jep/jep/2.24

将jep(https://github.com/shadaj/scalapy)的构建包含到此scala项目中

因此,我不想通过非托管依赖项手动构建jep,而是希望将其作为托管依赖项包含在内。因此我只包括:

resolvers += "jep" at "https://mvnrepository.com/artifact/"

libraryDependencies += "jep" % "jep" % "2.24" 
build.sbt中的

.jar正在下载并包含在我的.ivy2文件夹中,但在编译时,sbt似乎找不到它:

  > compile
[info] Updating {file:/C:/scalapy_indp/scalapy/}scalapy...
[info] Resolving org.sonatype.oss#oss-parent;9 ...
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-library;2.12.1!scala-library.jar (1406ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.1/scala-reflect-2.12.1.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-reflect;2.12.1!scala-reflect.jar (1156ms)
[info] downloading https://repo1.maven.org/maven2/jep/jep/2.24/jep-2.24.jar ...
[info]  [SUCCESSFUL ] jep#jep;2.24!jep.jar (188ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.1/scala-compiler-2.12.1.jar ...
[info]  [SUCCESSFUL ] org.scala-lang#scala-compiler;2.12.1!scala-compiler.jar (2469ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.6/scala-xml_2.12-1.0.6.jar ...
[info]  [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.12;1.0.6!scala-xml_2.12.jar(bundle) (360ms)
[info] downloading https://repo1.maven.org/maven2/jline/jline/2.14.1/jline-2.14.1.jar ...
[info]  [SUCCESSFUL ] jline#jline;2.14.1!jline.jar (250ms)
[info] Done updating.
[info] Compiling 16 Scala sources to C:\scalapy_indp\scalapy\target\scala-2.12\classes...
[info] 'compiler-interface' not yet compiled for Scala 2.12.1. Compiling...
[info]   Compilation completed in 15.285 s
[error] C:\scalapy_indp\scalapy\src\gen\scala\me\shadaj\scalapy\py\ObjectTupleReaders.scala:2: not found: object jep
[error] import jep.Jep
[error]        ^

当然,代码中的每个Jep外观都会出现错误。

我绝对不熟悉scala或sbt,我只是试图让它运行而不必使用非托管依赖项,即让它与平台无关。手动构建jep似乎与平台有关,正在创建的文件:

  

如果构建成功,它将创建一个目录jep / build   包含一个jep.jar和Jep的编译C库,通常命名为   jep.so或jep.dll取决于您的平台。

请参阅https://github.com/mrj0/jep/wiki/Getting-Started

1 个答案:

答案 0 :(得分:0)

正确设置了依赖关系,但导入错误。

尝试

import org.nfunk.jep.JEP

代替。

-

实际上,我刚刚意识到这可能是两个不同的项目。您包含的依赖项是这一个:http://sens.cse.msu.edu/Software/jep-2.23/doc/website/doc/doc_usage.htm