简体   繁体   English

SBT RabbitMQ Java导入不可用

[英]SBT RabbitMQ Java import not available

I am trying to import the RabbitMQ library into my SBT Scala project, but I cannot use it. 我试图将RabbitMQ库导入到我的SBT Scala项目中,但是我不能使用它。 SBT builds just fine. SBT构建良好。

Here is my build.sbt rabbitmq line: 这是我的build.sbt rabbitmq行:

libraryDependencies += "com.rabbitmq" % "amqp-client" % "3.4.2"

and here is my import line in a .scala file: 这是我在.scala文件中的导入行:

import com.rabbitmq.client.AMQP;

and here is my compile error: 这是我的编译错误:

Error:(5, 12) object rabbitmq is not a member of package com
    import com.rabbitmq.client.AMQP;
       ^

It seems that the import is simply not working, but I have no idea why... 似乎导入根本不起作用,但是我不知道为什么...

The issue was with another import. 问题出在另一个进口上。 I am using IntelliJ, and SBT importing failed silently with no errors until I used the 'SBT tasks' pane and the 'Refresh all SBT projects' button. 我使用的是IntelliJ,在我使用“ SBT任务”窗格和“刷新所有SBT项目”按钮之前,SBT导入无提示地失败,没有任何错误。 Once the offending import was gone, everything works again. 令人讨厌的导入一旦消失,一切都会再次起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM