对象kkapi不是包的成员

时间:2017-12-17 20:47:09

标签: scala intellij-idea

我正在尝试从另一个项目导入一个模块,并执行以下操作:

enter image description here

如图所示,导入的库为/home/developer/...kafka-api 我在测试中使用导入库。 当我使用语句test:compile编译我的spec文件时,我发现了以下错误:

[IJ]sbt:auth_stream> test:compile
[info] Compiling 3 Scala sources to /home/developer/Desktop/microservices/bary/auth-stream/target/scala-2.12/test-classes ...
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:14:20: object kkapi is not a member of package io.khinkali
[error] import io.khinkali.kkapi.consumer.{KkConsumer, KkConsumerConfig, KkConsumerCreator}
[error]                    ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:15:20: object kkapi is not a member of package io.khinkali
[error] import io.khinkali.kkapi.producer.{KkProducer, KkProducerCreator, MaxBlockMsConfig}
[error]                    ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:24:56: not found: value KkConsumer
[error]   private val consumer: IO[Consumer[String, String]] = KkConsumer.create(createConsumer())
[error]                                                        ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:52:5: not found: type KkConsumerCreator
[error]   : KkConsumerCreator
[error]     ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:25:56: not found: value KkProducer
[error]   private val producer: IO[Producer[String, String]] = KkProducer.create(createProducer())
[error]                                                        ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:46:5: not found: type KkProducerCreator
[error]   : KkProducerCreator
[error]     ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:47:5: not found: value KkProducerCreator
[error]   = KkProducerCreator(sys.env.get("KAFKA_SERVER").get,
[error]     ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:49:10: not found: value MaxBlockMsConfig
[error]     List(MaxBlockMsConfig(2000)))
[error]          ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:53:5: not found: value KkConsumerCreator
[error]   = KkConsumerCreator(sys.env.get("KAFKA_SERVER").get,
[error]     ^
[error] /home/developer/Desktop/microservices/bary/auth-stream/src/test/scala/io/khinkali/auth/AppSpec.scala:57:16: not found: type KkConsumerConfig
[error]     List.empty[KkConsumerConfig])
[error]                ^
[error] 10 errors found
[error] (test:compileIncremental) Compilation failed

我做错了什么?

提示,两个项目的包都以名称开头,即:
当前项目:
The current project

导入的项目:
enter image description here

如您所见,名称仅在结尾处有所不同。这可能是问题吗?

我想要解决的是,为kafka-api项目使用一个函数。

0 个答案:

没有答案