如何导入位于生成文件夹中的 Java 类?

huangapple 未分类评论50阅读模式
英文:

How to import java class that is in the generated folder?

问题

基本上我在使用 Protocol Buffers(protobuf)。protobuf 允许我通过 protobuf 插件(Gradle)生成 Java 代码(.java 文件)。
我的问题是生成的代码位于 build -> generated -> source -> proto -> main -> java 目录中,我很难将生成的代码导入到实际代码中(位于 src 文件夹中)。

英文:

So basically I'm using protobuf. Protobuf enables me to generate java code (.java files) thanks to the protobuf-plugin (gradle).
My problem is that the code is generated in the build -> generated -> source -> proto -> main -> java and I struggle to import the code that has been generated in my actual code (located in the src folder).

Image

huangapple
  • 本文由 发表于 2020年5月4日 21:04:43
  • 转载请务必保留本文链接:https://java.coder-hub.com/61592873.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定