简体   繁体   English

gRPC的IntelliJ编译错误

[英]IntelliJ Compiling error with gRPC

IntelliJ tells this compiling error, when I build a scala project to test gRPC APIs with Gatling. 当我构建一个scala项目以使用Gatling测试gRPC API时,IntelliJ会告知此编译错误。

IntelliJ: 的IntelliJ:

IntelliJ IDEA 2017.3.5 (Community Edition)
Build #IC-173.4674.33, built on March 6, 2018
JRE: 1.8.0_152-release-1024-b15 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

Scala Plugin Scala插件

Version: 2017.3.15

The project depends on another project(API). 该项目依赖于另一个项目(API)。 The latter one uses the following pom file (gRPC). 后者使用以下pom文件(gRPC)。

<dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-netty</artifactId>
    <version>1.7.0</version>
</dependency>
<dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-protobuf</artifactId>
    <version>1.7.0</version>
</dependency>
<dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-stub</artifactId>
    <version>1.7.0</version>
</dependency>

The code: 编码:

  val channel = ManagedChannelBuilder
      .forAddress("...", 8088)
      .usePlaintext(true)
      .build()   // <---- IntelliJ says "Error:..." here

Error: 错误:

Error:(10, 161) value build is not a member of ?0
  val channel = ManagedChannelBuilder.forAddress("...", 8088).usePlaintext(true).build()

I cannot see anything wrong with the code. 我看不到代码有什么问题。 Is it a bug of IntelliJ? 这是IntelliJ的错误吗?

Any help will be appreciated. 任何帮助将不胜感激。

That issue was a bug in Scala that was fixed in Scala 2.11 and later. 该问题是Scala中的一个错误,该错误已在Scala 2.11和更高版本中修复。 See grpc-java issue 2813 for discussion. 有关讨论,请参见grpc-java问题2813

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

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