Object kkapi is not a member of package

Hi all 


I am trying to import a module from another project and did as following:

enter image description here

As you can see on the image, the imported library is /home/developer/...kafka-api.
I am using the importing library in testing. When I compile my spec files with statement test:compile and I've got following error:

[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

What am I doing wrong?

Hint, that the package of both project starts with the name, namely:
The current project:
The current project

The imported project:
enter image description here

As you can see, the name differs only at the end. Could it be the problem? 



1 comment
Comment actions Permalink

It looks like you configured the dependency within IntelliJ, but tried to build using sbt. sbt does now know anything about the IntelliJ porject model, and there isn't any 2-way syncing. You will need to configure your project dependency from sbt and import this from IntelliJ. The keywords here are `RootProject` and `ProjectRef`, but in general this is an underdocumented feature of sbt.


Please sign in to leave a comment.