ScalaPb sbt:未找到导入"data/common/num.proto"或有错误



项目结构为:

logs
- data
- pubs
- invent.proto
- common
- num.proto

说明—"。proto"文件不在src/main/protobuf目录下。它们在logs目录下,直接在项目

下在invent.proto中,有import "data/common/num.proto";

我的构建。sbt是:

scalaVersion := "2.12.12"
libraryDependencies += "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
PB.includePaths in Compile := Seq(
baseDirectory.value / "logs"
)
excludeFilter in PB.generate := "test-*.proto"
PB.targets in Compile := Seq(
scalapb.gen() -> baseDirectory.value/"src/main/scala"
)
当我编译时,我得到以下错误:
data/common/num.proto: File not found.
data/pubs/invent.proto: Import "data/common/num.proto" was not found or had errors.

如何解决这个问题?我没有试图导入外部。proto文件。这些文件都在repo中。

删除PB.includePaths设置,并添加以下内容:

Compile / PB.protoSources := Seq(baseDirectory.value / "logs")

相关内容

  • 没有找到相关文章

最新更新